diff options
author | Alessandro Zummo <a.zummo@towertech.it> | 2014-04-03 17:49:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 19:21:16 -0400 |
commit | 4071ea25cc08d41002746cca2d69ac700d67a2ac (patch) | |
tree | 43cf44f8265b885c8c1e4e81f0ced5c6babb53c7 /drivers/rtc/rtc-ds1742.c | |
parent | a68b31080912dae377bee4994716b357dc74286d (diff) |
rtc: fix potential race condition
RTC drivers must not return an error after device registration.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Reported-by: Ales Novak <alnovak@suse.cz>
Cc: Alexander Shiyan <shc_work@mail.ru>
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Srikanth Srinivasan <srikanth.srinivasan@freescale.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-ds1742.c')
-rw-r--r-- | drivers/rtc/rtc-ds1742.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-ds1742.c b/drivers/rtc/rtc-ds1742.c index 5a1f3b2a8f1e..942103dac30f 100644 --- a/drivers/rtc/rtc-ds1742.c +++ b/drivers/rtc/rtc-ds1742.c | |||
@@ -204,8 +204,11 @@ static int ds1742_rtc_probe(struct platform_device *pdev) | |||
204 | return PTR_ERR(rtc); | 204 | return PTR_ERR(rtc); |
205 | 205 | ||
206 | ret = sysfs_create_bin_file(&pdev->dev.kobj, &pdata->nvram_attr); | 206 | ret = sysfs_create_bin_file(&pdev->dev.kobj, &pdata->nvram_attr); |
207 | if (ret) | ||
208 | dev_err(&pdev->dev, "Unable to create sysfs entry: %s\n", | ||
209 | pdata->nvram_attr.attr.name); | ||
207 | 210 | ||
208 | return ret; | 211 | return 0; |
209 | } | 212 | } |
210 | 213 | ||
211 | static int ds1742_rtc_remove(struct platform_device *pdev) | 214 | static int ds1742_rtc_remove(struct platform_device *pdev) |