summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorErnst Sjöstrand <ernstp@gmail.com>2017-11-08 22:47:06 +0100
committerAlex Deucher <alexander.deucher@amd.com>2017-11-08 17:30:11 -0500
commitf368d3bfde225199eef2216b03e0ba4944a3434a (patch)
treed4aeae53b3ec20afe0c996d2a7d03a6f5c5a4df8 /drivers/gpu
parentd83e87b239ec42eeda34850da342b3d8f104812b (diff)
amd/display: Fix potential null dereference in dce_calcs.c
Reported by smatch: bw_calcs() error: potential null dereference 'data' Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c2
1 files changed, 2 insertions, 0 deletions
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);