mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
drivers/rtc/class.c: fix device_register() error handling
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]>
This commit is contained in:
parent
d7c7ef908b
commit
59cca865f2
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue