From cc9fd77c08940c869cdfa38442f32458c5be900c Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 18 Oct 2013 10:46:33 +0300 Subject: [PATCH] OMAPDSS: connector-dvi: fix releasing i2c_adapter i2c adapter is not released correctly on error paths. Fix this. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/displays-new/connector-dvi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/video/omap2/displays-new/connector-dvi.c b/drivers/video/omap2/displays-new/connector-dvi.c index bc5f8ceda371..5641a23b78d1 100644 --- a/drivers/video/omap2/displays-new/connector-dvi.c +++ b/drivers/video/omap2/displays-new/connector-dvi.c @@ -262,6 +262,9 @@ static int dvic_probe_pdata(struct platform_device *pdev) in = omap_dss_find_output(pdata->source); if (in == NULL) { + if (ddata->i2c_adapter) + i2c_put_adapter(ddata->i2c_adapter); + dev_err(&pdev->dev, "Failed to find video source\n"); return -ENODEV; } @@ -313,6 +316,10 @@ static int dvic_probe(struct platform_device *pdev) err_reg: omap_dss_put_device(ddata->in); + + if (ddata->i2c_adapter) + i2c_put_adapter(ddata->i2c_adapter); + return r; }