]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bnxt_en: Fix possible memory leak in bnxt_rdma_aux_device_init()
authorVikas Gupta <vikas.gupta@broadcom.com>
Fri, 5 Apr 2024 23:55:11 +0000 (16:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2024 09:19:28 +0000 (11:19 +0200)
commitc60ed825530b8c0cc2b524efd39b1d696ec54004
tree2ffbd5ce2418cee9b9038df850261e0c3b2d2aea
parent1e91775286f278323ab46488b5094d2a388f4228
bnxt_en: Fix possible memory leak in bnxt_rdma_aux_device_init()

[ Upstream commit 7ac10c7d728d75bc9daaa8fade3c7a3273b9a9ff ]

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: 303432211324 ("bnxt_en: Remove runtime interrupt vector allocation")
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c