MLK-14454: video: mipi_dsi_northwest: Fix leaking a reset_control
authorLeonard Crestez <leonard.crestez@nxp.com>
Wed, 15 Mar 2017 14:34:45 +0000 (16:34 +0200)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:21:36 +0000 (15:21 -0500)
The mipi_dsi_disp_init function takes a reference to a reset_control
during initialization and does not release it.

This becomes a problem on 4.9 because reset_control_get has been split
into exclusive mode(default) and shared(which need to be marked).
Leaking a reference counts looks like attempting to fetch a second
reference to a controller and this WARNs and returns -EBUSY.

Fix by releasing it at the end of the function.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
drivers/video/fbdev/mxc/mipi_dsi_northwest.c

index 88e9f52..ce960ae 100644 (file)
@@ -164,11 +164,13 @@ static int mipi_dsi_disp_init(struct mxc_dispdrv_handle *disp,
        ret = mipi_dsi_lcd_init(mipi_dsi, setting);
        if (ret) {
                dev_err(dev, "failed to init mipi dsi lcd\n");
-               return ret;
+               goto out;
        }
 
        dev_info(dev, "MIPI DSI dispdv inited\n");
 
+out:
+       reset_control_put(reset);
        return ret;
 }