]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm: msm: dsi: keep a reference on msm_host->device_node until driver removal
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 5 Jan 2017 09:31:15 +0000 (10:31 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 7 Mar 2017 11:40:48 +0000 (12:40 +0100)
Since the device_node pointer is stored for later usage, its refcount
must not be decreased to prevent deletion of the object while it may
still be referenced.

drivers/gpu/drm/msm/dsi/dsi_host.c

index 25916502e429218435acb58446b89a732b91e181..f677e9b55c65922c712a9f06efdcdf3f4130c3a2 100644 (file)
@@ -1307,12 +1307,12 @@ static int dsi_host_detach(struct mipi_dsi_host *host,
 {
        struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
 
-       msm_host->device_node = NULL;
-
        DBG("id=%d", msm_host->id);
        if (msm_host->dev && of_drm_find_panel(msm_host->device_node))
                drm_helper_hpd_irq_event(msm_host->dev);
 
+       of_node_put(msm_host->device_node);
+       msm_host->device_node = NULL;
        return 0;
 }
 
@@ -1402,7 +1402,6 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
        }
 
        of_node_put(endpoint);
-       of_node_put(device_node);
 
        msm_host->device_node = device_node;