diff mbox series

drm/kmb: Use common error handling code in kmb_probe()

Message ID 591377f6-1926-49df-a1cf-6b621244a710@web.de (mailing list archive)
State New, archived
Headers show
Series drm/kmb: Use common error handling code in kmb_probe() | expand

Commit Message

Markus Elfring Oct. 3, 2024, 12:16 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 3 Oct 2024 13:20:05 +0200

Add a label so that a bit of exception handling can be better reused
in a subsequent if branch of this function implementation.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/gpu/drm/kmb/kmb_drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--
2.46.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/kmb/kmb_drv.c b/drivers/gpu/drm/kmb/kmb_drv.c
index 169b83987ce2..2680afa684a2 100644
--- a/drivers/gpu/drm/kmb/kmb_drv.c
+++ b/drivers/gpu/drm/kmb/kmb_drv.c
@@ -498,16 +498,16 @@  static int kmb_probe(struct platform_device *pdev)
 	}
 	dsi_node = of_graph_get_remote_port_parent(dsi_in);
 	if (!dsi_node) {
-		of_node_put(dsi_in);
 		DRM_ERROR("Failed to get dsi node from DT\n");
-		return -EINVAL;
+		goto err_put_dsi_in;
 	}

 	dsi_pdev = of_find_device_by_node(dsi_node);
 	if (!dsi_pdev) {
-		of_node_put(dsi_in);
 		of_node_put(dsi_node);
 		DRM_ERROR("Failed to get dsi platform device\n");
+err_put_dsi_in:
+		of_node_put(dsi_in);
 		return -EINVAL;
 	}