Explorar o código

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>
Ernst Sjöstrand %!s(int64=7) %!d(string=hai) anos
pai
achega
f368d3bfde
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c

+ 2 - 0
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);