[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240610102056.40406-1-amjad.ouled-ameur@arm.com>
Date: Mon, 10 Jun 2024 11:20:56 +0100
From: Amjad Ouled-Ameur <amjad.ouled-ameur@....com>
To: dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Cc: Amjad Ouled-Ameur <amjad.ouled-ameur@....com>,
Liviu Dudau <liviu.dudau@....com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Smitha T Murthy <smitha.tmurthy@....com>,
Deepak Pandey <deepak.pandey@....com>
Subject: [PATCH] drm/komeda: check for error-valued pointer
komeda_pipeline_get_state() may return an error-valued pointer, thus
check the pointer for negative or null value before dereferencing.
Signed-off-by: Amjad Ouled-Ameur <amjad.ouled-ameur@....com>
---
drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
index f3e744172673..f4e76b46ca32 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
@@ -259,7 +259,7 @@ komeda_component_get_avail_scaler(struct komeda_component *c,
u32 avail_scalers;
pipe_st = komeda_pipeline_get_state(c->pipeline, state);
- if (!pipe_st)
+ if (IS_ERR_OR_NULL(pipe_st))
return NULL;
avail_scalers = (pipe_st->active_comps & KOMEDA_PIPELINE_SCALERS) ^
--
2.25.1
Powered by blists - more mailing lists