]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: ethernet: microchip: lan743x: Fix driver crash when lan743x_pm_resume fails
authorYuiko Oshino <yuiko.oshino@microchip.com>
Fri, 22 Oct 2021 15:13:53 +0000 (11:13 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 24 Oct 2021 12:37:48 +0000 (13:37 +0100)
The driver needs to clean up and return when the initialization fails on resume.

Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver")
Signed-off-by: Yuiko Oshino <yuiko.oshino@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/microchip/lan743x_main.c

index 9e8561cdc32a409ae959f5ee93b0e2b7ec7e739a..3ac968b1c6ce9e6e5dde2751055f2a6a4aeaeeaa 100644 (file)
@@ -3019,6 +3019,8 @@ static int lan743x_pm_resume(struct device *dev)
        if (ret) {
                netif_err(adapter, probe, adapter->netdev,
                          "lan743x_hardware_init returned %d\n", ret);
+               lan743x_pci_cleanup(adapter);
+               return ret;
        }
 
        /* open netdev when netdev is at running state while resume.