]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/rtc/rtc-ds1307.c: release irq on error
authorSachin Kamat <sachin.kamat@linaro.org>
Tue, 5 Nov 2013 05:57:07 +0000 (16:57 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 5 Nov 2013 05:57:07 +0000 (16:57 +1100)
'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>
drivers/rtc/rtc-ds1307.c

index ca18fd1433b3db9e61ade3acb62dacc7dcee779f..e8ac439c43a549142b7aa47f40452baf260f1d50 100644 (file)
@@ -956,7 +956,7 @@ read_rtc:
                                        GFP_KERNEL);
                if (!ds1307->nvram) {
                        err = -ENOMEM;
-                       goto exit;
+                       goto err_irq;
                }
                ds1307->nvram->attr.name = "nvram";
                ds1307->nvram->attr.mode = S_IRUGO | S_IWUSR;
@@ -967,13 +967,15 @@ read_rtc:
                ds1307->nvram_offset = chip->nvram_offset;
                err = sysfs_create_bin_file(&client->dev.kobj, ds1307->nvram);
                if (err)
-                       goto exit;
+                       goto err_irq;
                set_bit(HAS_NVRAM, &ds1307->flags);
                dev_info(&client->dev, "%zu bytes nvram\n", ds1307->nvram->size);
        }
 
        return 0;
 
+err_irq:
+       free_irq(client->irq, client);
 exit:
        return err;
 }