diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-25 11:12:29 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-25 11:12:29 +0100 |
commit | 072a51be8ecfb84e15b27b7f80a601560f386788 (patch) | |
tree | cd7bee45536733a987e70037b109eb1bd9a4cc36 /drivers/net/ethernet/natsemi/macsonic.c | |
parent | Revert "drivers: core: Detach device from power domain on shutdown" (diff) | |
parent | Linux 5.11-rc5 (diff) | |
download | linux-072a51be8ecfb84e15b27b7f80a601560f386788.tar.xz linux-072a51be8ecfb84e15b27b7f80a601560f386788.zip |
Merge 5.11-rc5 into driver-core-next
We need the fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/ethernet/natsemi/macsonic.c')
-rw-r--r-- | drivers/net/ethernet/natsemi/macsonic.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c index 776b7d264dc3..2289e1fe3741 100644 --- a/drivers/net/ethernet/natsemi/macsonic.c +++ b/drivers/net/ethernet/natsemi/macsonic.c @@ -506,10 +506,14 @@ static int mac_sonic_platform_probe(struct platform_device *pdev) err = register_netdev(dev); if (err) - goto out; + goto undo_probe; return 0; +undo_probe: + dma_free_coherent(lp->device, + SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode), + lp->descriptors, lp->descriptors_laddr); out: free_netdev(dev); @@ -584,12 +588,16 @@ static int mac_sonic_nubus_probe(struct nubus_board *board) err = register_netdev(ndev); if (err) - goto out; + goto undo_probe; nubus_set_drvdata(board, ndev); return 0; +undo_probe: + dma_free_coherent(lp->device, + SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode), + lp->descriptors, lp->descriptors_laddr); out: free_netdev(ndev); return err; |