From: "shenyang (M)" <shenyang39@huawei.com>
To: Markus Elfring <Markus.Elfring@web.de>,
Sihang Chen <chensihang1@hisilicon.com>,
<linux-crypto@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Herbert Xu <herbert@gondor.apana.org.au>,
Zaibo Xu <xuzaibo@huawei.com>,
Zhou Wang <wangzhou1@hisilicon.com>
Subject: Re: [PATCH v4 01/10] crypto: hisilicon/qm - fix wrong release after using strsep
Date: Wed, 5 Aug 2020 09:58:00 +0800 [thread overview]
Message-ID: <425f4bdd-cf55-6537-28bf-0377564b531b@huawei.com> (raw)
In-Reply-To: <96ffa633-dda1-7ad1-72da-5563906c1561@web.de>
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
next parent reply other threads:[~2020-08-05 1:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <96ffa633-dda1-7ad1-72da-5563906c1561@web.de>
2020-08-05 1:58 ` shenyang (M) [this message]
[not found] ` <5554863d-f0d7-a396-7d13-e187fa9ca6bf@web.de>
2020-08-06 1:33 ` [v4 " shenyang (M)
[not found] ` <c28f472c-4d7b-0afd-5ad7-3cc322aad404@web.de>
2020-08-07 8:06 ` shenyang (M)
2020-08-04 13:58 [PATCH v4 00/10] crypto: hisilicon/qm - misc fixes Yang Shen
2020-08-04 13:58 ` [PATCH v4 01/10] crypto: hisilicon/qm - fix wrong release after using strsep Yang Shen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=425f4bdd-cf55-6537-28bf-0377564b531b@huawei.com \
--to=shenyang39@huawei.com \
--cc=Markus.Elfring@web.de \
--cc=chensihang1@hisilicon.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wangzhou1@hisilicon.com \
--cc=xuzaibo@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®