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>] [day] [month] [year] [list]
Date:   Wed, 29 Nov 2023 01:47:59 -0800
From:   Haoran Liu <liuhaoran14@....com>
To:     alain.volmat@...s.st.com
Cc:     maarten.lankhorst@...ux.intel.com, mripard@...nel.org,
        tzimmermann@...e.de, airlied@...il.com, daniel@...ll.ch,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        Haoran Liu <liuhaoran14@....com>
Subject: [PATCH] [drm/sti] sti_compositor: Add error handlingin sti_compositor_bind

Previously, the function sti_compositor_bind did not properly
handle potential failure scenarios of drm_vblank_init, which could
lead to unexpected behavior. This update adds a check for the
return value of drm_vblank_init.

Signed-off-by: Haoran Liu <liuhaoran14@....com>
---
 drivers/gpu/drm/sti/sti_compositor.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sti/sti_compositor.c b/drivers/gpu/drm/sti/sti_compositor.c
index 33487a1fed8f..beddbd1c48eb 100644
--- a/drivers/gpu/drm/sti/sti_compositor.c
+++ b/drivers/gpu/drm/sti/sti_compositor.c
@@ -69,6 +69,7 @@ static int sti_compositor_bind(struct device *dev,
 	struct drm_plane *primary = NULL;
 	struct sti_compositor_subdev_descriptor *desc = compo->data.subdev_desc;
 	unsigned int array_size = compo->data.nb_subdev;
+	int ret;
 
 	dev_priv->compo = compo;
 
@@ -145,7 +146,11 @@ static int sti_compositor_bind(struct device *dev,
 		}
 	}
 
-	drm_vblank_init(drm_dev, crtc_id);
+	ret = drm_vblank_init(drm_dev, crtc_id);
+	if (ret) {
+		DRM_ERROR("Failed to initialize vblank\n");
+		return ret;
+	}
 
 	return 0;
 }
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ