mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
can: flexcan: fix use after free of priv
The priv is part of the memory allocated by alloc_candev(). This patch moved the free it after last usage of priv. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
06d6e6d2e4
commit
9a27586d3d
1 changed files with 2 additions and 1 deletions
|
@ -992,7 +992,6 @@ static int __devexit flexcan_remove(struct platform_device *pdev)
|
|||
|
||||
unregister_flexcandev(dev);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
free_candev(dev);
|
||||
iounmap(priv->base);
|
||||
|
||||
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
|
@ -1000,6 +999,8 @@ static int __devexit flexcan_remove(struct platform_device *pdev)
|
|||
|
||||
clk_put(priv->clk);
|
||||
|
||||
free_candev(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue