diff mbox series

[2/3] drm/bridge: tc358775: Fix drm_of_get_data_lanes_count_ep conversion

Message ID 20220612132152.91052-2-marex@denx.de (mailing list archive)
State New, archived
Headers show
Series [1/3] drm: of: Mark empty drm_of_get_data_lanes_count and drm_of_get_data_lanes_ep static | expand

Commit Message

Marek Vasut June 12, 2022, 1:21 p.m. UTC
Initialize dsi_lanes to -1, so that in case the endpoint is missing,
probe would fail as it did before the conversion, instead of depending
on uninitialized variable and thus undefined behavior.

Fixes: 56426faa1492 ("drm/bridge: tc358775: Convert to drm_of_get_data_lanes_count_ep")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
To: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/bridge/tc358775.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sam Ravnborg June 12, 2022, 1:39 p.m. UTC | #1
On Sun, Jun 12, 2022 at 03:21:51PM +0200, Marek Vasut wrote:
> Initialize dsi_lanes to -1, so that in case the endpoint is missing,
> probe would fail as it did before the conversion, instead of depending
> on uninitialized variable and thus undefined behavior.
> 
> Fixes: 56426faa1492 ("drm/bridge: tc358775: Convert to drm_of_get_data_lanes_count_ep")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Maxime Ripard <maxime@cerno.tech>
> Cc: Robert Foss <robert.foss@linaro.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> To: dri-devel@lists.freedesktop.org
Acked-by: Sam Ravnborg <sam@ravnborg.org>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c
index 5b1fb8e2f9a7d..e5d00a6e7880b 100644
--- a/drivers/gpu/drm/bridge/tc358775.c
+++ b/drivers/gpu/drm/bridge/tc358775.c
@@ -529,7 +529,7 @@  static int tc358775_parse_dt(struct device_node *np, struct tc_data *tc)
 	struct device_node *endpoint;
 	struct device_node *parent;
 	struct device_node *remote;
-	int dsi_lanes;
+	int dsi_lanes = -1;
 
 	/*
 	 * To get the data-lanes of dsi, we need to access the dsi0_out of port1