myri10ge: Fix an error handling path in myri10ge_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 18 Dec 2022 18:08:40 +0000 (19:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jan 2023 11:07:30 +0000 (12:07 +0100)
[ Upstream commit d83b950d44d2982c0e62e3d81b0f35ab09431008 ]

Some memory allocated in myri10ge_probe_slices() is not released in the
error handling path of myri10ge_probe().

Add the corresponding kfree(), as already done in the remove function.

Fixes: 0dcffac1a329 ("myri10ge: add multislices support")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/myricom/myri10ge/myri10ge.c

index 5eeba263b5f8af58106eb169e2f370b009f7905c..d50cee7aae4d5b36dd3cc966502ef484d2465ccf 100644 (file)
@@ -4152,6 +4152,7 @@ abort_with_slices:
        myri10ge_free_slices(mgp);
 
 abort_with_firmware:
+       kfree(mgp->msix_vectors);
        myri10ge_dummy_rdma(mgp, 0);
 
 abort_with_ioremap: