mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
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: 9ed0343f56
("octeontx2-pf: Add devlink port support")
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Link: https://patch.msgid.link/20241217052326.1086191-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
5eecd85c77
commit
51df947678
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user