]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: sunhme: Fix uninitialized return code
authorSean Anderson <seanga2@gmail.com>
Fri, 24 Mar 2023 17:51:27 +0000 (13:51 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Mar 2023 07:41:56 +0000 (08:41 +0100)
Fix an uninitialized return code if we never found a qfe slot. It would be
a bug if we ever got into this situation, but it's good to return something
tracable.

Fixes: acb3f35f920b ("sunhme: forward the error code from pci_enable_device()")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sun/sunhme.c

index b0c7ab74a82ed11b0f70495d78acd1d6971f0dc0..7cf8210ebbec37602be91dcf7bc98e92b8394ed7 100644 (file)
@@ -2834,7 +2834,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
        int i, qfe_slot = -1;
        char prom_name[64];
        u8 addr[ETH_ALEN];
-       int err;
+       int err = -ENODEV;
 
        /* Now make sure pci_dev cookie is there. */
 #ifdef CONFIG_SPARC