Skip to content

Commit

Permalink
amd/display: Fix potential null dereference in dce_calcs.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ernst Sjöstrand authored and Alex Deucher committed Nov 8, 2017
1 parent d83e87b commit f368d3b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit f368d3b

Please sign in to comment.