On 2020/8/5 2:34, Markus Elfring wrote:
…
+++ b/drivers/crypto/hisilicon/qm.c
@@ -1420,16 +1420,17 @@ static int qm_dbg_help(struct hisi_qm *qm, char *s)
…
+ s_tmp = s;
presult = strsep(&s, " ");
if (!presult) {
- kfree(s);
+ kfree(s_tmp);
return -EINVAL;
}
- kfree(s);
- return -EINVAL;
+ ret = -EINVAL;
+ goto free_tmp;
I suggest to add a jump target for the desired exception handling.
Regards,
Markus
.
Thanks for your review. There is only one error branch need to do
something uninit. So I think the jump is not necessary and will
affect code reading.:)
Thanks,
Yang