Skip to content

Commit 20fb7c7

Browse files
wenwenwang1davem330
authored andcommitted
net: myri10ge: fix memory leaks
In myri10ge_probe(), myri10ge_alloc_slices() is invoked to allocate slices related structures. Later on, myri10ge_request_irq() is used to get an irq. However, if this process fails, the allocated slices related structures are not deallocated, leading to memory leaks. To fix this issue, revise the target label of the goto statement to 'abort_with_slices'. Signed-off-by: Wenwen Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d85f017 commit 20fb7c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/myricom/myri10ge/myri10ge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3919,7 +3919,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
39193919
* setup (if available). */
39203920
status = myri10ge_request_irq(mgp);
39213921
if (status != 0)
3922-
goto abort_with_firmware;
3922+
goto abort_with_slices;
39233923
myri10ge_free_irq(mgp);
39243924

39253925
/* Save configuration space to be restored if the

0 commit comments

Comments
 (0)