From: Tony Lu <tonylu@linux.alibaba.com>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
"D. Wythe" <alibuda@linux.alibaba.com>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Jan Karcher <jaka@linux.ibm.com>, Paolo Abeni <pabeni@redhat.com>,
Wen Gu <guwen@linux.alibaba.com>,
Wenjia Zhang <wenjia@linux.ibm.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] net/smc: Return directly after a failed kzalloc() in smc_fill_gid_list()
Date: Tue, 2 Jan 2024 10:13:17 +0800 [thread overview]
Message-ID: <ZZNxPadDoJ6gxRmb@TONYMAC-ALIBABA.local> (raw)
In-Reply-To: <f02303c3-5968-48c3-990b-be0be8a66521@web.de>
On Sun, Dec 31, 2023 at 03:58:15PM +0100, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 31 Dec 2023 15:15:19 +0100
>
> The kfree() function was called in one case by
> the smc_fill_gid_list() function during error handling
> even if the passed variable contained a null pointer.
> This issue was detected by using the Coccinelle software.
>
> Thus return directly after a call of the function "kzalloc" failed
> at the beginning.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
LGTM, thank you.
Also please add net tag in subject and fixes tag in commit body.
Reviewed-by: Tony Lu <tonylu@linux.alibaba.com>
> ---
> net/smc/af_smc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
> index 7fc2f3c6d248..a396a9977ba9 100644
> --- a/net/smc/af_smc.c
> +++ b/net/smc/af_smc.c
> @@ -1180,7 +1180,7 @@ void smc_fill_gid_list(struct smc_link_group *lgr,
>
> alt_ini = kzalloc(sizeof(*alt_ini), GFP_KERNEL);
> if (!alt_ini)
> - goto out;
> + return;
>
> alt_ini->vlan_id = lgr->vlan_id;
> alt_ini->check_smcrv2 = true;
> --
> 2.43.0
next prev parent reply other threads:[~2024-01-02 2:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-31 14:55 [PATCH 0/2] net/smc: Adjustments for two function implementations Markus Elfring
2023-12-31 14:58 ` [PATCH 1/2] net/smc: Return directly after a failed kzalloc() in smc_fill_gid_list() Markus Elfring
2024-01-02 2:13 ` Tony Lu [this message]
2023-12-31 15:00 ` [PATCH 2/2] net/smc: Improve exception handling in smc_llc_cli_add_link_invite() Markus Elfring
2023-12-31 22:09 ` kernel test robot
2023-12-31 22:40 ` kernel test robot
2024-01-02 2:19 ` Tony Lu
2024-01-02 8:13 ` [PATCH 0/2] net/smc: Adjustments for two function implementations Wen Gu
2024-01-02 8:44 ` Tony Lu
2024-01-02 8:51 ` [0/2] " Markus Elfring
2024-01-02 11:33 ` Wen Gu
2024-01-02 11:50 ` Markus Elfring
2024-01-04 20:40 ` Simon Horman
2024-01-03 13:44 ` [PATCH 0/2] " Wenjia Zhang
2024-01-03 14:16 ` [0/2] " Markus Elfring
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=ZZNxPadDoJ6gxRmb@TONYMAC-ALIBABA.local \
--to=tonylu@linux.alibaba.com \
--cc=Markus.Elfring@web.de \
--cc=alibuda@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=guwen@linux.alibaba.com \
--cc=jaka@linux.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=wenjia@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).