Reported-by smatch:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:966 dc_commit_planes_to_stream() error: potential null dereference 'flip_addr'.  (kcalloc returns null)
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:968 dc_commit_planes_to_stream() error: potential null dereference 'plane_info'.  (kcalloc returns null)
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:978 dc_commit_planes_to_stream() error: potential null dereference 'scaling_info'.  (kcalloc returns null)
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
        scaling_info = kcalloc(MAX_SURFACES, sizeof(struct dc_scaling_info),
                               GFP_KERNEL);
 
+       if (!flip_addr || !plane_info || !scaling_info) {
+               kfree(flip_addr);
+               kfree(plane_info);
+               kfree(scaling_info);
+               kfree(stream_update);
+               return false;
+       }
+
        memset(updates, 0, sizeof(updates));
 
        stream_update->src = dc_stream->src;