OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
06d6e6d
)
can: flexcan: fix use after free of priv
author
Marc Kleine-Budde
<mkl@pengutronix.de>
Thu, 21 Oct 2010 05:07:58 +0000
(
05:07
+0000)
committer
David S. Miller
<davem@davemloft.net>
Tue, 26 Oct 2010 17:48:58 +0000
(10:48 -0700)
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>
drivers/net/can/flexcan.c
patch
|
blob
|
history
diff --git
a/drivers/net/can/flexcan.c
b/drivers/net/can/flexcan.c
index
ef443a0
..
d499056
100644
(file)
--- 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)
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;
}