RE: [EXTERNAL] [PATCH net v2 1/2] octeontx2-pf: fix netdev memory leak in rvu_rep_create()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




>-----Original Message-----
>From: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>
>Sent: Tuesday, December 17, 2024 10:53 AM
>To: Sunil Kovvuri Goutham <sgoutham@xxxxxxxxxxx>; Geethasowjanya Akula
><gakula@xxxxxxxxxxx>; Subbaraya Sundeep Bhatta <sbhatta@xxxxxxxxxxx>;
>Hariprasad Kelam <hkelam@xxxxxxxxxxx>; Bharat Bhushan
><bbhushan2@xxxxxxxxxxx>; Andrew Lunn <andrew+netdev@xxxxxxx>; David
>S. Miller <davem@xxxxxxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>;
>Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>; Simon
>Horman <horms@xxxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; linux-
>kernel@xxxxxxxxxxxxxxx
>Cc: dan.carpenter@xxxxxxxxxx; kernel-janitors@xxxxxxxxxxxxxxx;
>error27@xxxxxxxxx; harshit.m.mogalapalli@xxxxxxxxxx; Przemek Kitszel
><przemyslaw.kitszel@xxxxxxxxx>
>Subject: [EXTERNAL] [PATCH net v2 1/2] octeontx2-pf: fix netdev memory leak
>in rvu_rep_create()
>
>When rvu_rep_devlink_port_register() fails, free_netdev(ndev) for this
>incomplete iteration before going to "exit:" label.
>
>Fixes: 9ed0343f561e ("octeontx2-pf: Add devlink port support")
>Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@xxxxxxxxx>
>Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>
>---
>v1-->v2: Change the Fixes tag to the correct one as pointed out by
>v1-->Przemek
>---
> 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);
>--
>2.46.0
Ack. Thanks for the fix.






[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux