net: moxa: Fix a potential double 'free_irq()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 26 Apr 2020 20:59:21 +0000 (22:59 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 May 2020 03:23:49 +0000 (20:23 -0700)
Should an irq requested with 'devm_request_irq' be released explicitly,
it should be done by 'devm_free_irq()', not 'free_irq()'.

Fixes: 6c821bd9edc9 ("net: Add MOXA ART SoCs ethernet driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/moxa/moxart_ether.c

index e1651756bf9da181a089caccc7011c33fd9f4267..f70bb81e1ed652c44242ecd39e7bcf700dcfdb30 100644 (file)
@@ -564,7 +564,7 @@ static int moxart_remove(struct platform_device *pdev)
        struct net_device *ndev = platform_get_drvdata(pdev);
 
        unregister_netdev(ndev);
-       free_irq(ndev->irq, ndev);
+       devm_free_irq(&pdev->dev, ndev->irq, ndev);
        moxart_mac_free_memory(ndev);
        free_netdev(ndev);