Re: [PATCH v2] net: moxa: dispose IRQ mappings on probe failure and device removal

Andrew Lunn <[email protected]>
Newsgroups org.kernel.vger.netdev
Message-ID <[email protected]>
> --- a/drivers/net/ethernet/moxa/moxart_ether.c
> +++ b/drivers/net/ethernet/moxa/moxart_ether.c
> @@ -543,15 +543,18 @@ static int moxart_mac_probe(struct platform_device *pdev)
>  
>  	ret = register_netdev(ndev);
>  	if (ret)
> -		goto init_fail;
> +		goto free_irq_dispose;
>  
>  	netdev_dbg(ndev, "%s: IRQ=%d address=%pM\n",
>  		   __func__, ndev->irq, ndev->dev_addr);
>  
>  	return 0;
>  
> +free_irq_dispose:
> +	devm_free_irq(p_dev, irq, ndev);
>  init_fail:
>  	netdev_err(ndev, "init failed\n");
> +	irq_dispose_mapping(irq);

Calling devm_free_FOO() suggests there are other problems, likely a
bad conversion to devm_FOO().

Please take a look at the whole of probe() and fix all its problems.

Also, please read:

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

    Andrew

---
pw-bot: cr
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.