[PATCH v6 3/3] drm/komeda: Fix IS_ERR_OR_NULL() vs NULL check in komeda_component_get_avail_scaler()
Gaosheng Cui
cuigaosheng1 at huawei.com
Tue Jul 25 01:39:57 UTC 2023
The komeda_pipeline_get_state() returns an ERR_PTR() on failure,
and a null is catastrophic here we should use IS_ERR_OR_NULL()
to check the return value.
Fixes: 502932a03fce ("drm/komeda: Add the initial scaler support for CORE")
Signed-off-by: Gaosheng Cui <cuigaosheng1 at huawei.com>
Reviewed-by: Liviu Dudau <liviu.dudau at arm.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 3276a3e82c62..f7281dd99727 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
More information about the dri-devel
mailing list