Selaa lähdekoodia

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 7 vuotta sitten
vanhempi
commit
f368d3bfde
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  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),
 	struct bw_calcs_data *data = kzalloc(sizeof(struct bw_calcs_data),
 					     GFP_KERNEL);
 					     GFP_KERNEL);
+	if (!data)
+		return false;
 
 
 	populate_initial_data(pipe, pipe_count, data);
 	populate_initial_data(pipe, pipe_count, data);