Message ID | 20230314003613.3874089-9-seanga2@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: sunhme: Probe/IRQ cleanups | expand |
On Mon, 13 Mar 2023 20:36:12 -0400 Sean Anderson wrote:
> Fixes: 96c6e9faecf1 ("sunhme: forward the error code from pci_enable_device()")
No such commit in our trees :(
On 3/15/23 03:51, Jakub Kicinski wrote: > On Mon, 13 Mar 2023 20:36:12 -0400 Sean Anderson wrote: >> Fixes: 96c6e9faecf1 ("sunhme: forward the error code from pci_enable_device()") > > No such commit in our trees :( Ah, looks like I forgot this was bad when copying the other commit. It should be acb3f35f920b. --Sean
On Wed, Mar 15, 2023 at 11:36:25AM -0400, Sean Anderson wrote: > On 3/15/23 03:51, Jakub Kicinski wrote: > > On Mon, 13 Mar 2023 20:36:12 -0400 Sean Anderson wrote: > > > Fixes: 96c6e9faecf1 ("sunhme: forward the error code from pci_enable_device()") > > > > No such commit in our trees :( > > Ah, looks like I forgot this was bad when copying the other commit. It should be acb3f35f920b. I agree that is the correct commit. And the code changes look good to me. But I wonder if the fix should be separated into another patch, separate from the cleanup.
diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c index 1f27e99abf17..a59b998062d9 100644 --- a/drivers/net/ethernet/sun/sunhme.c +++ b/drivers/net/ethernet/sun/sunhme.c @@ -2622,29 +2622,25 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, err = pcim_enable_device(pdev); if (err) - goto err_out; + return err; pci_set_master(pdev); if (!strcmp(prom_name, "SUNW,qfe") || !strcmp(prom_name, "qfe")) { qp = quattro_pci_find(pdev); - if (IS_ERR(qp)) { - err = PTR_ERR(qp); - goto err_out; - } + if (IS_ERR(qp)) + return PTR_ERR(qp); for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) if (!qp->happy_meals[qfe_slot]) break; if (qfe_slot == 4) - goto err_out; + return -ENODEV; } dev = devm_alloc_etherdev(&pdev->dev, sizeof(struct happy_meal)); - if (!dev) { - err = -ENOMEM; - goto err_out; - } + if (!dev) + return -ENOMEM; SET_NETDEV_DEV(dev, &pdev->dev); hp = netdev_priv(dev); @@ -2792,8 +2788,6 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, err_out_clear_quattro: if (qp != NULL) qp->happy_meals[qfe_slot] = NULL; - -err_out: return err; }
The err_out label used to have cleanup. Now that it just returns, inline it everywhere. While we're at it, fix an uninitialized return code if we never found a qfe slot. Fixes: 96c6e9faecf1 ("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> --- Changes in v3: - Incorperate a fix from another series into this commit Changes in v2: - New drivers/net/ethernet/sun/sunhme.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)