Skip to content

Commit

Permalink
net/macb: fix misplaced call of free_netdev() in macb_remove()
Browse files Browse the repository at this point in the history
fix a bug introduced by the multiqueue support patch:
"net/macb: add TX multiqueue support for gem"

the "bp" pointer to the netdev private data was dereferenced and used after the
associated memory had been freed by calling free_netdev().

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Cyrille Pitchen authored and David S. Miller committed Dec 15, 2014
1 parent 6ff4a8a commit e965be7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/cadence/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2408,11 +2408,11 @@ static int __exit macb_remove(struct platform_device *pdev)
queue = bp->queues;
for (q = 0; q < bp->num_queues; ++q, ++queue)
devm_free_irq(&pdev->dev, queue->irq, queue);
free_netdev(dev);
if (!IS_ERR(bp->tx_clk))
clk_disable_unprepare(bp->tx_clk);
clk_disable_unprepare(bp->hclk);
clk_disable_unprepare(bp->pclk);
free_netdev(dev);
}

return 0;
Expand Down

0 comments on commit e965be7

Please sign in to comment.