diff options
author | Harry Wentland <harry.wentland@amd.com> | 2017-11-10 19:49:44 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-11-28 17:56:26 -0500 |
commit | b3fb2b4e21a995c4fa511627088bd55b88f6be11 (patch) | |
tree | 97307c799c07261c2e53a8a46baa108e5cfe8c25 | |
parent | b001965d4eb5e4c0e3de7dc6dce1d45ca25232a7 (diff) |
drm/amd/display: Fix hubp check in set_cursor_position
Found by smatch:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:298
dc_stream_set_cursor_position() error: we previously assumed 'hubp'
could be null (see line 294)
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/inc/hw/transform.h | 7 |
2 files changed, 4 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c index b00a6040a697..e230cc44a0a7 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c | |||
@@ -263,7 +263,6 @@ bool dc_stream_set_cursor_position( | |||
263 | struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp; | 263 | struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp; |
264 | struct mem_input *mi = pipe_ctx->plane_res.mi; | 264 | struct mem_input *mi = pipe_ctx->plane_res.mi; |
265 | struct hubp *hubp = pipe_ctx->plane_res.hubp; | 265 | struct hubp *hubp = pipe_ctx->plane_res.hubp; |
266 | struct transform *xfm = pipe_ctx->plane_res.xfm; | ||
267 | struct dpp *dpp = pipe_ctx->plane_res.dpp; | 266 | struct dpp *dpp = pipe_ctx->plane_res.dpp; |
268 | struct dc_cursor_position pos_cpy = *position; | 267 | struct dc_cursor_position pos_cpy = *position; |
269 | struct dc_cursor_mi_param param = { | 268 | struct dc_cursor_mi_param param = { |
@@ -294,11 +293,11 @@ bool dc_stream_set_cursor_position( | |||
294 | if (mi != NULL && mi->funcs->set_cursor_position != NULL) | 293 | if (mi != NULL && mi->funcs->set_cursor_position != NULL) |
295 | mi->funcs->set_cursor_position(mi, &pos_cpy, ¶m); | 294 | mi->funcs->set_cursor_position(mi, &pos_cpy, ¶m); |
296 | 295 | ||
297 | if (hubp != NULL && hubp->funcs->set_cursor_position != NULL) | 296 | if (!hubp) |
298 | hubp->funcs->set_cursor_position(hubp, &pos_cpy, ¶m); | 297 | continue; |
299 | 298 | ||
300 | if (xfm != NULL && xfm->funcs->set_cursor_position != NULL) | 299 | if (hubp->funcs->set_cursor_position != NULL) |
301 | xfm->funcs->set_cursor_position(xfm, &pos_cpy, ¶m, hubp->curs_attr.width); | 300 | hubp->funcs->set_cursor_position(hubp, &pos_cpy, ¶m); |
302 | 301 | ||
303 | if (dpp != NULL && dpp->funcs->set_cursor_position != NULL) | 302 | if (dpp != NULL && dpp->funcs->set_cursor_position != NULL) |
304 | dpp->funcs->set_cursor_position(dpp, &pos_cpy, ¶m, hubp->curs_attr.width); | 303 | dpp->funcs->set_cursor_position(dpp, &pos_cpy, ¶m, hubp->curs_attr.width); |
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/transform.h b/drivers/gpu/drm/amd/display/dc/inc/hw/transform.h index 7c08bc62c1f5..ea88997e1bbd 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/transform.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/transform.h | |||
@@ -259,13 +259,6 @@ struct transform_funcs { | |||
259 | struct transform *xfm_base, | 259 | struct transform *xfm_base, |
260 | const struct dc_cursor_attributes *attr); | 260 | const struct dc_cursor_attributes *attr); |
261 | 261 | ||
262 | void (*set_cursor_position)( | ||
263 | struct transform *xfm_base, | ||
264 | const struct dc_cursor_position *pos, | ||
265 | const struct dc_cursor_mi_param *param, | ||
266 | uint32_t width | ||
267 | ); | ||
268 | |||
269 | }; | 262 | }; |
270 | 263 | ||
271 | const uint16_t *get_filter_2tap_16p(void); | 264 | const uint16_t *get_filter_2tap_16p(void); |