amd/display: Fix potential null dereference in dce_calcs.c
Subsystems (3)
PATCH v2 1/1 amd/display: Fix potential null dereference in dce_calcs.c
Reported by smatch:bw_calcs() error: potential null dereference 'data'
---
I couldn't use DC_ERROR because the dc_context had the wrong variable name. Seems like a larger project to fix...
drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +2 -0
@@ -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);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20171108214706.5579-1-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Quoted 4 lines · Ernst Sjöstrand
Reported by smatch:
bw_calcs()error: potential null dereference 'data'Signed-off-by Ernst Sjöstrand <[email protected]>
Reviewed and pushed. thanks!
Alex
Quoted 23 lines
---
I couldn't useDC_ERRORbecause thedc_contexthad the wrong variable name. Seems like a larger project to fix...drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +2
-1@@ -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); --2.14.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx