Skip to contentSkip to conversation

drm/exynos: checking for NULL instead of IS_ERR()

PATCH In review Dan Carpenter 2 participants 2 messages Oct 13, 2018 – Oct 15, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/exynos: checking for NULL instead of IS_ERR()

The of_drm_find_panel() function returns error pointers and never NULL but we the driver assumes that ->panel is NULL when it's not present.

Fixes 6afb7721e2a0 ("drm/exynos: move connector creation to attach callback")
drivers/gpu/drm/exynos/exynos_drm_dsi.c +3 -1
index 07af7758066d..32f256749789 100644
@@ -1527,7 +1527,9 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
 		}
 
 		dsi->panel = of_drm_find_panel(device->dev.of_node);
-		if (dsi->panel) {
+		if (IS_ERR(dsi->panel)) {
+			dsi->panel = NULL;
+		} else {
 			drm_panel_attach(dsi->panel, &dsi->connector);
 			dsi->connector.status = connector_status_connected;
 		}
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

The of_drm_find_panel() function returns error pointers and never NULL but we the driver assumes that ->panel is NULL when it's not present.

Fixes 6afb7721e2a0 ("drm/exynos: move connector creation to attach callback")

Thanks for spotting it (and sorry for previous reply mistake).

--
Regards
Andrzej

Quoted 21 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +3 -1
index 07af7758066d..32f256749789 100644
@@ -1527,7 +1527,9 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
 		}
 
 		dsi->panel = of_drm_find_panel(device->dev.of_node);
-		if (dsi->panel) {
+		if (IS_ERR(dsi->panel)) {
+			dsi->panel = NULL;
+		} else {
 			drm_panel_attach(dsi->panel, &dsi->connector);
 			dsi->connector.status = connector_status_connected;
 		}

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel