lkml.org 
[lkml]   [2020]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 01/10] crypto: hisilicon/qm - fix wrong release after using strsep
From
Date


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

\
 
 \ /
  Last update: 2020-08-05 03:58    [W:0.052 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site