projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8422c74
)
pwm: sysfs: Use put_device() instead of kfree()
author
Arvind Yadav
<arvind.yadav.cs@gmail.com>
Thu, 8 Mar 2018 09:57:37 +0000
(15:27 +0530)
committer
Thierry Reding
<thierry.reding@gmail.com>
Tue, 27 Mar 2018 23:18:53 +0000
(
01:18
+0200)
Never directly free @dev after calling device_register(), even if it
returned an error! Always use put_device() to give up the reference
initialized.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/sysfs.c
patch
|
blob
|
history
diff --git
a/drivers/pwm/sysfs.c
b/drivers/pwm/sysfs.c
index
83f2b0b
..
7c71cdb
100644
(file)
--- a/
drivers/pwm/sysfs.c
+++ b/
drivers/pwm/sysfs.c
@@
-273,7
+273,8
@@
static int pwm_export_child(struct device *parent, struct pwm_device *pwm)
ret = device_register(&export->child);
if (ret) {
clear_bit(PWMF_EXPORTED, &pwm->flags);
- kfree(export);
+ put_device(&export->child);
+ export = NULL;
return ret;
}