Skip to content

Commit ff2da5a

Browse files
vikasbrcmvijay-suman
authored andcommitted
bnxt_en: Fix possible memory leak in bnxt_rdma_aux_device_init()
[ Upstream commit 7ac10c7 ] If ulp = kzalloc() fails, the allocated edev will leak because it is not properly assigned and the cleanup path will not be able to free it. Fix it by assigning it properly immediately after allocation. Fixes: 3034322 ("bnxt_en: Remove runtime interrupt vector allocation") Reviewed-by: Andy Gospodarek <[email protected]> Signed-off-by: Vikas Gupta <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit c60ed825530b8c0cc2b524efd39b1d696ec54004) Orabug: 37070270 CVE: CVE-2024-35972 Signed-off-by: Saeed Mirzamohammadi <[email protected]> Reviewed-by: Harshit Mogalapalli <[email protected]> Signed-off-by: Vijayendra Suman <[email protected]>
1 parent 06ef1bc commit ff2da5a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,12 +392,13 @@ void bnxt_rdma_aux_device_init(struct bnxt *bp)
392392
if (!edev)
393393
goto aux_dev_uninit;
394394

395+
aux_priv->edev = edev;
396+
395397
ulp = kzalloc(sizeof(*ulp), GFP_KERNEL);
396398
if (!ulp)
397399
goto aux_dev_uninit;
398400

399401
edev->ulp_tbl = ulp;
400-
aux_priv->edev = edev;
401402
bp->edev = edev;
402403
bnxt_set_edev_info(edev, bp);
403404

0 commit comments

Comments
 (0)