mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 00:51:35 +00:00
workqueue: use put_device() instead of kfree()
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>
This commit is contained in:
parent
fc6eabbbf8
commit
537f4146c5
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue