From f368d3bfde225199eef2216b03e0ba4944a3434a Mon Sep 17 00:00:00 2001 From: Ernst Sjöstrand Date: Wed, 8 Nov 2017 22:47:06 +0100 Subject: amd/display: Fix potential null dereference in dce_calcs.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported by smatch: bw_calcs() error: potential null dereference 'data' Reviewed-by: Alex Deucher Signed-off-by: Ernst Sjöstrand Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/gpu') diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c index 4f8a95368ffc..6347712db834 100644 --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c @@ -2794,6 +2794,8 @@ bool bw_calcs(struct dc_context *ctx, { struct bw_calcs_data *data = kzalloc(sizeof(struct bw_calcs_data), GFP_KERNEL); + if (!data) + return false; populate_initial_data(pipe, pipe_count, data); -- cgit v1.2.3