net: lantiq: fix missing free_netdev() on error in ltq_etop_probe()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 30 Nov 2021 03:38:37 +0000 (11:38 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Nov 2021 12:11:27 +0000 (12:11 +0000)
Add the missing free_netdev() before return from ltq_etop_probe()
in the error handling case.

Fixes: 14d4e308e0aa ("net: lantiq: configure the burst length in ethernet drivers")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/lantiq_etop.c

index 072391c..14059e1 100644 (file)
@@ -687,13 +687,13 @@ ltq_etop_probe(struct platform_device *pdev)
        err = device_property_read_u32(&pdev->dev, "lantiq,tx-burst-length", &priv->tx_burst_len);
        if (err < 0) {
                dev_err(&pdev->dev, "unable to read tx-burst-length property\n");
-               return err;
+               goto err_free;
        }
 
        err = device_property_read_u32(&pdev->dev, "lantiq,rx-burst-length", &priv->rx_burst_len);
        if (err < 0) {
                dev_err(&pdev->dev, "unable to read rx-burst-length property\n");
-               return err;
+               goto err_free;
        }
 
        for (i = 0; i < MAX_DMA_CHAN; i++) {