diff mbox

m5mols: Add missing free_irq() on error path

Message ID 1345126570-17919-1-git-send-email-s.nawrocki@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Make sure the interrupt is freed when the driver probing fails.

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: HeungJun Kim <riverful.kim@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/media/video/m5mols/m5mols_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
1.7.11.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/video/m5mols/m5mols_core.c b/drivers/media/video/m5mols/m5mols_core.c
index ac7d28b..8bf6599 100644
--- a/drivers/media/video/m5mols/m5mols_core.c
+++ b/drivers/media/video/m5mols/m5mols_core.c
@@ -931,7 +931,7 @@  static int __devinit m5mols_probe(struct i2c_client *client,

 	ret = m5mols_sensor_power(info, true);
 	if (ret)
-		goto out_me;
+		goto out_irq;

 	ret = m5mols_fw_start(sd);
 	if (!ret)
@@ -940,6 +940,8 @@  static int __devinit m5mols_probe(struct i2c_client *client,
 	m5mols_sensor_power(info, false);
 	if (!ret)
 		return 0;
+out_irq:
+	free_irq(client->irq, sd);
 out_me:
 	media_entity_cleanup(&sd->entity);
 out_reg: