From: Jakub Kicinski <kuba@kernel.org>
To: Jianglei Nie <niejianglei2021@163.com>
Cc: linux@armlinux.org.uk, andrew@lunn.ch, hkallweit1@gmail.com,
davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] net: sfp: fix memory leak in sfp_probe()
Date: Mon, 27 Jun 2022 22:11:05 -0700 [thread overview]
Message-ID: <20220627221105.5a5feb7c@kernel.org> (raw)
In-Reply-To: <20220624044941.1807118-1-niejianglei2021@163.com>
On Fri, 24 Jun 2022 12:49:41 +0800 Jianglei Nie wrote:
> sfp_probe() allocates a memory chunk from sfp with sfp_alloc(). When
> devm_add_action() fails, sfp is not freed, which leads to a memory leak.
>
> We should use devm_add_action_or_reset() instead of devm_add_action().
Please add a Fixes tag referencing the commit which added the bug.
The subject for the next version should be start with [PATCH net v3].
prev parent reply other threads:[~2022-06-28 5:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 4:49 [PATCH v2] net: sfp: fix memory leak in sfp_probe() Jianglei Nie
2022-06-28 5:11 ` Jakub Kicinski [this message]
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=20220627221105.5a5feb7c@kernel.org \
--to=kuba@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=niejianglei2021@163.com \
--cc=pabeni@redhat.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).