diff options
author | Wenwen Wang <wenwen@cs.uga.edu> | 2019-08-14 09:38:39 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-15 22:44:58 +0300 |
commit | 20fb7c7a39b5c719e2e619673b5f5729ee7d2306 (patch) | |
tree | 4756b319838f0ffac3ffae2f50b39544f42a60fb | |
parent | d85f01775850a35eae47a0090839baf510c1ef12 (diff) | |
download | linux-20fb7c7a39b5c719e2e619673b5f5729ee7d2306.tar.xz |
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 <wenwen@cs.uga.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c index d8b7fba96d58..337b0cbfd153 100644 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c @@ -3919,7 +3919,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) * setup (if available). */ status = myri10ge_request_irq(mgp); if (status != 0) - goto abort_with_firmware; + goto abort_with_slices; myri10ge_free_irq(mgp); /* Save configuration space to be restored if the |