Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 502932a03fce ("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

authored by

Amjad Ouled-Ameur and committed by
Maxime Ripard
b880018e f74fb5df

+1 -1
+1 -1
drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
··· 259 259 u32 avail_scalers; 260 260 261 261 pipe_st = komeda_pipeline_get_state(c->pipeline, state); 262 - if (!pipe_st) 262 + if (IS_ERR_OR_NULL(pipe_st)) 263 263 return NULL; 264 264 265 265 avail_scalers = (pipe_st->active_comps & KOMEDA_PIPELINE_SCALERS) ^