diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-11-12 18:10:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:26 -0500 |
commit | 50ccf0455e51eba51e645b3724c8e932c75774b1 (patch) | |
tree | 03e552a50e5de17414216da90a55a41b46546992 /drivers/rtc | |
parent | 10992435b30eb470e6b91d2415abfb79680d00b6 (diff) |
drivers/rtc/rtc-ds1307.c: release irq on error
'client->irq' was not released on error. Fix it.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-ds1307.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index ca18fd1433b3..e8ac439c43a5 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c | |||
@@ -956,7 +956,7 @@ read_rtc: | |||
956 | GFP_KERNEL); | 956 | GFP_KERNEL); |
957 | if (!ds1307->nvram) { | 957 | if (!ds1307->nvram) { |
958 | err = -ENOMEM; | 958 | err = -ENOMEM; |
959 | goto exit; | 959 | goto err_irq; |
960 | } | 960 | } |
961 | ds1307->nvram->attr.name = "nvram"; | 961 | ds1307->nvram->attr.name = "nvram"; |
962 | ds1307->nvram->attr.mode = S_IRUGO | S_IWUSR; | 962 | ds1307->nvram->attr.mode = S_IRUGO | S_IWUSR; |
@@ -967,13 +967,15 @@ read_rtc: | |||
967 | ds1307->nvram_offset = chip->nvram_offset; | 967 | ds1307->nvram_offset = chip->nvram_offset; |
968 | err = sysfs_create_bin_file(&client->dev.kobj, ds1307->nvram); | 968 | err = sysfs_create_bin_file(&client->dev.kobj, ds1307->nvram); |
969 | if (err) | 969 | if (err) |
970 | goto exit; | 970 | goto err_irq; |
971 | set_bit(HAS_NVRAM, &ds1307->flags); | 971 | set_bit(HAS_NVRAM, &ds1307->flags); |
972 | dev_info(&client->dev, "%zu bytes nvram\n", ds1307->nvram->size); | 972 | dev_info(&client->dev, "%zu bytes nvram\n", ds1307->nvram->size); |
973 | } | 973 | } |
974 | 974 | ||
975 | return 0; | 975 | return 0; |
976 | 976 | ||
977 | err_irq: | ||
978 | free_irq(client->irq, client); | ||
977 | exit: | 979 | exit: |
978 | return err; | 980 | return err; |
979 | } | 981 | } |