Commit 50ccf045 authored by Sachin Kamat's avatar Sachin Kamat Committed by Linus Torvalds

drivers/rtc/rtc-ds1307.c: release irq on error

'client->irq' was not released on error. Fix it.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 10992435
......@@ -956,7 +956,7 @@ static int ds1307_probe(struct i2c_client *client,
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 @@ static int ds1307_probe(struct i2c_client *client,
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment