Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64f48e59 authored by Joao Pinto's avatar Joao Pinto Committed by David S. Miller
Browse files

net: stmicro: replace kzalloc with devm_kzalloc



The axi variable was not being freed upon device removal.
With devm_kzalloc it ensures that it is properly freed.

Signed-off-by: default avatarJoao Pinto <jpinto@synopsys.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e3c36e48
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ static struct stmmac_axi *stmmac_axi_setup(struct platform_device *pdev)
	if (!np)
		return NULL;

	axi = kzalloc(sizeof(*axi), GFP_KERNEL);
	axi = devm_kzalloc(&pdev->dev, sizeof(*axi), GFP_KERNEL);
	if (!axi) {
		of_node_put(np);
		return ERR_PTR(-ENOMEM);