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:
d7c7ef9
)
drivers/rtc/class.c: fix device_register() error handling
author
Vasiliy Kulikov
<
[email protected]
>
Wed, 27 Oct 2010 22:33:04 +0000
(15:33 -0700)
committer
Linus Torvalds
<
[email protected]
>
Thu, 28 Oct 2010 01:03:06 +0000
(18:03 -0700)
If device_register() fails then call put_device(). See comment to
device_register.
Signed-off-by: Vasiliy Kulikov <
[email protected]
>
Cc: Alessandro Zummo <
[email protected]
>
Cc: Wan ZongShun <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/rtc/class.c
patch
|
blob
|
history
diff --git
a/drivers/rtc/class.c
b/drivers/rtc/class.c
index 565562ba6ac9dacc7d8aa4842c7ddedb29de074d..e6539cbabb35fb8f143f1710a004744fa1abe745 100644
(file)
--- a/
drivers/rtc/class.c
+++ b/
drivers/rtc/class.c
@@
-158,8
+158,10
@@
struct rtc_device *rtc_device_register(const char *name, struct device *dev,
rtc_dev_prepare(rtc);
err = device_register(&rtc->dev);
- if (err)
+ if (err) {
+ put_device(&rtc->dev);
goto exit_kfree;
+ }
rtc_dev_add_device(rtc);
rtc_sysfs_add_device(rtc);