Patchwork [01/10] drivers/rtc/rtc-ds1307.c: Release irq on error

login
register
mail settings
Submitter Sachin Kamat
Date Sept. 6, 2013, 11:33 a.m.
Message ID <1378467223-26231-1-git-send-email-sachin.kamat@linaro.org>
Download mbox | patch
Permalink /patch/273153/
State New
Headers show

Comments

Sachin Kamat - Sept. 6, 2013, 11:33 a.m.
'client->irq' was not released on error. Fix it.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/rtc/rtc-ds1307.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index ca18fd1..e8ac439 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -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;
 }