Commit 1c470b53 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Jakub Kicinski

r8169: use pm_runtime_put_sync in rtl_open error path

We can safely runtime-suspend the chip if rtl_open() fails. Therefore
switch the error path to use pm_runtime_put_sync() as well.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/aa093b1e-f295-5700-1cb7-954b54dd8f17@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3a689e34
...@@ -4701,7 +4701,7 @@ static int rtl_open(struct net_device *dev) ...@@ -4701,7 +4701,7 @@ static int rtl_open(struct net_device *dev)
tp->TxDescArray = dma_alloc_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray = dma_alloc_coherent(&pdev->dev, R8169_TX_RING_BYTES,
&tp->TxPhyAddr, GFP_KERNEL); &tp->TxPhyAddr, GFP_KERNEL);
if (!tp->TxDescArray) if (!tp->TxDescArray)
goto err_pm_runtime_put; goto out;
tp->RxDescArray = dma_alloc_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray = dma_alloc_coherent(&pdev->dev, R8169_RX_RING_BYTES,
&tp->RxPhyAddr, GFP_KERNEL); &tp->RxPhyAddr, GFP_KERNEL);
...@@ -4726,9 +4726,9 @@ static int rtl_open(struct net_device *dev) ...@@ -4726,9 +4726,9 @@ static int rtl_open(struct net_device *dev)
rtl8169_up(tp); rtl8169_up(tp);
rtl8169_init_counter_offsets(tp); rtl8169_init_counter_offsets(tp);
netif_start_queue(dev); netif_start_queue(dev);
pm_runtime_put_sync(&pdev->dev);
out: out:
pm_runtime_put_sync(&pdev->dev);
return retval; return retval;
err_free_irq: err_free_irq:
...@@ -4744,8 +4744,6 @@ static int rtl_open(struct net_device *dev) ...@@ -4744,8 +4744,6 @@ static int rtl_open(struct net_device *dev)
dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray, dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray,
tp->TxPhyAddr); tp->TxPhyAddr);
tp->TxDescArray = NULL; tp->TxDescArray = NULL;
err_pm_runtime_put:
pm_runtime_put_noidle(&pdev->dev);
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment