Skip to content

Commit

Permalink
via-rhine: gotoize rhine_open error path.
Browse files Browse the repository at this point in the history
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
françois romieu authored and David S. Miller committed May 4, 2015
1 parent a21bb8b commit 4d1fd9c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions drivers/net/ethernet/via/via-rhine.c
Original file line number Diff line number Diff line change
Expand Up @@ -1688,15 +1688,14 @@ static int rhine_open(struct net_device *dev)

rc = request_irq(rp->irq, rhine_interrupt, IRQF_SHARED, dev->name, dev);
if (rc)
return rc;
goto out;

netif_dbg(rp, ifup, dev, "%s() irq %d\n", __func__, rp->irq);

rc = alloc_ring(dev);
if (rc) {
free_irq(rp->irq, dev);
return rc;
}
if (rc < 0)
goto out_free_irq;

alloc_rbufs(dev);
alloc_tbufs(dev);
rhine_chip_reset(dev);
Expand All @@ -1709,7 +1708,12 @@ static int rhine_open(struct net_device *dev)

netif_start_queue(dev);

return 0;
out:
return rc;

out_free_irq:
free_irq(rp->irq, dev);
goto out;
}

static void rhine_reset_task(struct work_struct *work)
Expand Down

0 comments on commit 4d1fd9c

Please sign in to comment.