diff mbox series

drm/bridge: display-connector: fix an uninitialized pointer in probe()

Message ID 20211013080825.GE6010@kili (mailing list archive)
State New, archived
Headers show
Series drm/bridge: display-connector: fix an uninitialized pointer in probe() | expand

Commit Message

Dan Carpenter Oct. 13, 2021, 8:08 a.m. UTC
The "label" pointer is used for debug output.  The code assumes that it
is either NULL or valid, but it is never set to NULL.  It is either
valid or uninitialized.

Fixes: 0c275c30176b ("drm/bridge: Add bridge driver for display connectors")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/bridge/display-connector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sam Ravnborg Oct. 14, 2021, 6:54 p.m. UTC | #1
Hi Dan,

On Wed, Oct 13, 2021 at 11:08:25AM +0300, Dan Carpenter wrote:
> The "label" pointer is used for debug output.  The code assumes that it
> is either NULL or valid, but it is never set to NULL.  It is either
> valid or uninitialized.
> 
> Fixes: 0c275c30176b ("drm/bridge: Add bridge driver for display connectors")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks, applied to drm-misc-next.
It was IMO not urgent.

	Sam
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c
index 05eb759da6fc..847a0dce7f1d 100644
--- a/drivers/gpu/drm/bridge/display-connector.c
+++ b/drivers/gpu/drm/bridge/display-connector.c
@@ -107,7 +107,7 @@  static int display_connector_probe(struct platform_device *pdev)
 {
 	struct display_connector *conn;
 	unsigned int type;
-	const char *label;
+	const char *label = NULL;
 	int ret;
 
 	conn = devm_kzalloc(&pdev->dev, sizeof(*conn), GFP_KERNEL);