From: Shirish S Date: Thu, 26 Oct 2017 06:17:42 +0000 (+0530) Subject: drm/amd/display: fix null pointer dereference X-Git-Tag: v4.15-rc1~56^2~2^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55d9038b0c680ec90e3a7d2440e717ac6a2a8064;p=thirdparty%2Flinux.git drm/amd/display: fix null pointer dereference While setting cursor position in case of mpo, input_pixel_processor is not available for underlay, hence add check of the same to avoid null pointer access issue. Signed-off-by: Shirish S Reviewed-by: Harry Wentland Reviewed-by: Tony Cheng Signed-off-by: Alex Deucher --- 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 5cf69af9693d2..572b885195c75 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c @@ -288,7 +288,7 @@ bool dc_stream_set_cursor_position( pos_cpy.enable = false; - if (ipp->funcs->ipp_cursor_set_position != NULL) + if (ipp !=NULL && ipp->funcs->ipp_cursor_set_position != NULL) ipp->funcs->ipp_cursor_set_position(ipp, &pos_cpy, ¶m); if (mi != NULL && mi->funcs->set_cursor_position != NULL)