]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: myri10ge: fix memory leaks
authorWenwen Wang <wenwen@cs.uga.edu>
Wed, 14 Aug 2019 06:38:39 +0000 (01:38 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Aug 2019 19:44:58 +0000 (12:44 -0700)
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>
drivers/net/ethernet/myricom/myri10ge/myri10ge.c

index d8b7fba96d58ed109a4962e0128909f9ea283e50..337b0cbfd153ef6bdabcbd8f4e26a1b21bfb2b00 100644 (file)
@@ -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