ethernet: sun: Free the coherent when failing in probing
Subsystems (3)
PATCH 1/1 ethernet: sun: Free the coherent when failing in probing
When the driver fails to register net device, it should free the DMA region first, and then do other cleanup.
Signed-off-by Zheyu Ma <[email protected]>
--- drivers/net/ethernet/sun/sunhme.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/sun/sunhme.c +5 -1
@@ -3146,7 +3146,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,if (err) {printk (KERN_ERR "happymeal(PCI): Cannot register net device, " "aborting.\n" ); - goto err_out_iounmap; + goto err_out_free_coherent; }pci_set_drvdata (pdev, hp);
@@ -3179,6 +3179,10 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,return 0 ; +err_out_free_coherent: +dma_free_coherent (hp->dma_dev,PAGE_SIZE , + hp->happy_block, hp->hblock_dvma); + err_out_iounmap:iounmap (hp->gregs);
Signature · 1 line
2.25.1
Quoted 4 lines · Zheyu Ma
When the driver fails to register net device, it should free the DMA region first, and then do other cleanup.
Signed-off-by Zheyu Ma <[email protected]>
Reviewed-by Andrew Lunn <[email protected]>
Andrew
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:
Quoted 7 lines · On Sat, 5 Mar 2022 14:55:04 +0000 you wrote:
When the driver fails to register net device, it should free the DMA region first, and then do other cleanup.
Signed-off-by Zheyu Ma <[email protected]>--- drivers/net/ethernet/sun/sunhme.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Here is the summary with links:
- ethernet: sun: Free the coherent when failing in probing
https://git.kernel.org/netdev/net/c/bb77bd31c281
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html