OSDN Git Service

net: ixp4xx_hss: drop kfree for memory allocated with devm_kzalloc
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 30 Nov 2021 10:48:40 +0000 (10:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Nov 2021 12:40:22 +0000 (12:40 +0000)
It's not necessary to free memory allocated with devm_kzalloc
and using kfree leads to a double free.

Fixes: 35aefaad326b ("net: ixp4xx_hss: Convert to use DT probing")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/ixp4xx_hss.c

index d02d8a2..0b7d9f2 100644 (file)
@@ -1508,7 +1508,6 @@ static int ixp4xx_hss_remove(struct platform_device *pdev)
        unregister_hdlc_device(port->netdev);
        free_netdev(port->netdev);
        npe_release(port->npe);
-       kfree(port);
        return 0;
 }