Skip to content

Commit b880018

Browse files
amjoul01mripard
authored andcommitted
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. Fixes: 502932a ("drm/komeda: Add the initial scaler support for CORE") Signed-off-by: Amjad Ouled-Ameur <amjad.ouled-ameur@arm.com> Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240610102056.40406-1-amjad.ouled-ameur@arm.com
1 parent f74fb5d commit b880018

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ komeda_component_get_avail_scaler(struct komeda_component *c,
259259
u32 avail_scalers;
260260

261261
pipe_st = komeda_pipeline_get_state(c->pipeline, state);
262-
if (!pipe_st)
262+
if (IS_ERR_OR_NULL(pipe_st))
263263
return NULL;
264264

265265
avail_scalers = (pipe_st->active_comps & KOMEDA_PIPELINE_SCALERS) ^

0 commit comments

Comments
 (0)