diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2010-10-21 01:07:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-26 13:48:58 -0400 |
commit | 9a27586d3d5c3157260b055d057c6f4f6654c72c (patch) | |
tree | 27ac8230bde3a11881795acedc7b4c44671a8fbe /drivers/net/can | |
parent | 06d6e6d2e4ef61172f342fddeea5cfa465d81578 (diff) |
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>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/flexcan.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index ef443a090ba7..d4990568baee 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
@@ -992,7 +992,6 @@ static int __devexit flexcan_remove(struct platform_device *pdev) | |||
992 | 992 | ||
993 | unregister_flexcandev(dev); | 993 | unregister_flexcandev(dev); |
994 | platform_set_drvdata(pdev, NULL); | 994 | platform_set_drvdata(pdev, NULL); |
995 | free_candev(dev); | ||
996 | iounmap(priv->base); | 995 | iounmap(priv->base); |
997 | 996 | ||
998 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 997 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -1000,6 +999,8 @@ static int __devexit flexcan_remove(struct platform_device *pdev) | |||
1000 | 999 | ||
1001 | clk_put(priv->clk); | 1000 | clk_put(priv->clk); |
1002 | 1001 | ||
1002 | free_candev(dev); | ||
1003 | |||
1003 | return 0; | 1004 | return 0; |
1004 | } | 1005 | } |
1005 | 1006 | ||