projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
533221f
)
[PATCH] Fix device_attribute memory leak in device_del
author
Catalin Marinas
<
[email protected]
>
Sat, 25 Nov 2006 19:09:30 +0000
(11:09 -0800)
committer
Linus Torvalds
<
[email protected]
>
Sat, 25 Nov 2006 21:28:33 +0000
(13:28 -0800)
dev->devt_attr is allocated in device_add() but it is never freed in
device_del() in the drivers/base/core.c file (reported by kmemleak).
Signed-off-by: Catalin Marinas <
[email protected]
>
Acked-by: Greg KH <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/base/core.c
patch
|
blob
|
history
diff --git
a/drivers/base/core.c
b/drivers/base/core.c
index 68ad11af22b41e307277f3826be989c37dbe2bbf..002fde46d38d71737ae07f6d905f8f2b5a8e4603 100644
(file)
--- a/
drivers/base/core.c
+++ b/
drivers/base/core.c
@@
-591,8
+591,10
@@
void device_del(struct device * dev)
if (parent)
klist_del(&dev->knode_parent);
- if (dev->devt_attr)
+ if (dev->devt_attr)
{
device_remove_file(dev, dev->devt_attr);
+ kfree(dev->devt_attr);
+ }
if (dev->class) {
sysfs_remove_link(&dev->kobj, "subsystem");
sysfs_remove_link(&dev->class->subsys.kset.kobj, dev->bus_id);