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:
fc6eabb
)
workqueue: use put_device() instead of kfree()
author
Arvind Yadav
<arvind.yadav.cs@gmail.com>
Tue, 6 Mar 2018 10:05:43 +0000
(15:35 +0530)
committer
Tejun Heo
<tj@kernel.org>
Tue, 13 Mar 2018 20:26:03 +0000
(13:26 -0700)
Never directly free @dev after calling device_register(), even
if it returned an error! Always use put_device() to give up the
reference initialized in this function instead.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c
patch
|
blob
|
history
diff --git
a/kernel/workqueue.c
b/kernel/workqueue.c
index bb9a519cbf5093ece372daa532121f1511957999..ccd1080dd6e7108a9521a0d2ea6d1a9a52c6431c 100644
(file)
--- a/
kernel/workqueue.c
+++ b/
kernel/workqueue.c
@@
-5337,7
+5337,7
@@
int workqueue_sysfs_register(struct workqueue_struct *wq)
ret = device_register(&wq_dev->dev);
if (ret) {
-
kfree(wq_
dev);
+
put_device(&wq_dev->
dev);
wq->wq_dev = NULL;
return ret;
}