All of lore.kernel.org
 help / color / mirror / Atom feed
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] net: sfp: fix memory leak in sfp_probe()
Date: Thu, 23 Jun 2022 12:14:21 -0700	[thread overview]
Message-ID: <20220623121421.3bc054d2@kernel.org> (raw)
In-Reply-To: <20220623070914.1781700-1-niejianglei2021@163.com>

On Thu, 23 Jun 2022 15:09:14 +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 free the sfp with sfp_cleanup() when devm_add_action() fails.

.. and please add a Fixes tag

      parent reply	other threads:[~2022-06-23 19:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23  7:09 [PATCH] net: sfp: fix memory leak in sfp_probe() Jianglei Nie
2022-06-23  7:20 ` Michael Walle
2022-06-23  8:24 ` Christophe JAILLET
2022-06-23 19:14 ` 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=20220623121421.3bc054d2@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.