From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: <dan.carpenter@linaro.org>, <kernel-janitors@vger.kernel.org>,
<error27@gmail.com>, Sunil Goutham <sgoutham@marvell.com>,
Geetha sowjanya <gakula@marvell.com>,
Subbaraya Sundeep <sbhatta@marvell.com>,
hariprasad <hkelam@marvell.com>,
Bharat Bhushan <bbhushan2@marvell.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH next 1/2] octeontx2-pf: fix netdev memory leak in rvu_rep_create()
Date: Mon, 16 Dec 2024 09:09:58 +0100 [thread overview]
Message-ID: <74d65f76-5e3a-44b6-b857-42b6c8cf7789@intel.com> (raw)
In-Reply-To: <20241216070516.4036749-1-harshit.m.mogalapalli@oracle.com>
On 12/16/24 08:05, Harshit Mogalapalli wrote:
> When rvu_rep_devlink_port_register() fails, free_netdev(ndev) for this
> incomplete iteration before going to "exit:" label.
>
> Fixes: 3937b7308d4f ("octeontx2-pf: Create representor netdev")
I would say that you are fixing:
Fixes: 9ed0343f561e ("octeontx2-pf: Add devlink port support")
this is also a -net material
code is fine otherwise, so:
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
> This is found by Smatch, based on static analysis, only compile tested.
> ---
> drivers/net/ethernet/marvell/octeontx2/nic/rep.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
> index 232b10740c13..9e3fcbae5dee 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
> @@ -680,8 +680,10 @@ int rvu_rep_create(struct otx2_nic *priv, struct netlink_ext_ack *extack)
> ndev->features |= ndev->hw_features;
> eth_hw_addr_random(ndev);
> err = rvu_rep_devlink_port_register(rep);
> - if (err)
> + if (err) {
> + free_netdev(ndev);
> goto exit;
> + }
>
> SET_NETDEV_DEVLINK_PORT(ndev, &rep->dl_port);
> err = register_netdev(ndev);
next prev parent reply other threads:[~2024-12-16 8:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-16 7:05 [PATCH next 1/2] octeontx2-pf: fix netdev memory leak in rvu_rep_create() Harshit Mogalapalli
2024-12-16 7:05 ` [PATCH next 2/2] octeontx2-pf: fix error handling of devlink port " Harshit Mogalapalli
2024-12-16 8:13 ` Przemek Kitszel
2024-12-16 8:09 ` Przemek Kitszel [this message]
2024-12-16 9:05 ` [PATCH next 1/2] octeontx2-pf: fix netdev memory leak " Harshit Mogalapalli
2024-12-16 9:15 ` Przemek Kitszel
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=74d65f76-5e3a-44b6-b857-42b6c8cf7789@intel.com \
--to=przemyslaw.kitszel@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=bbhushan2@marvell.com \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=error27@gmail.com \
--cc=gakula@marvell.com \
--cc=harshit.m.mogalapalli@oracle.com \
--cc=hkelam@marvell.com \
--cc=horms@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.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