lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230924074216.17390-1-liuhaoran14@163.com>
Date:   Sun, 24 Sep 2023 15:42:16 +0800
From:   liuhaoran <liuhaoran14@....com>
To:     airlied@...il.com
Cc:     daniel@...ll.ch, jernej.skrabec@...il.com, samuel@...lland.org,
        dri-devel@...ts.freedesktop.org,
        linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
        linux-kernel@...r.kernel.org, liuhaoran <liuhaoran14@....com>
Subject: [PATCH] drm/sun4i: Add error handling in sun4i_layer_init_one()

This patch adds error-handling for the drm_plane_create_alpha_property()
and drm_plane_create_zpos_property() inside the dw_hdmi_imx_probe().

Signed-off-by: liuhaoran <liuhaoran14@....com>
---
 drivers/gpu/drm/sun4i/sun4i_layer.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
index 98f3176366c0..a3343afb7935 100644
--- a/drivers/gpu/drm/sun4i/sun4i_layer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
@@ -224,9 +224,22 @@ static struct sun4i_layer *sun4i_layer_init_one(struct drm_device *drm,
 	drm_plane_helper_add(&layer->plane,
 			     &sun4i_backend_layer_helper_funcs);
 
-	drm_plane_create_alpha_property(&layer->plane);
-	drm_plane_create_zpos_property(&layer->plane, layer->id,
-				       0, SUN4I_BACKEND_NUM_LAYERS - 1);
+	ret = drm_plane_create_alpha_property(&layer->plane);
+
+	if (ret) {
+		dev_err(drm->dev, "Failed to install alpha property,
+			rc = %d\n", ret);
+		return ERR_PTR(ret);
+	}
+
+	ret = drm_plane_create_zpos_property(&layer->plane, layer->id, 0,
+					     SUN4I_BACKEND_NUM_LAYERS - 1);
+
+	if (ret) {
+		dev_err(drm->dev, "Failed to install zpos property,
+			rc = %d\n", ret);
+		return ERR_PTR(ret);
+	}
 
 	return layer;
 }
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ