All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] amd/display: Fix potential null dereference in dce_calcs.c
@ 2017-11-08 21:47 Ernst Sjöstrand
       [not found] ` <20171108214706.5579-1-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Ernst Sjöstrand @ 2017-11-08 21:47 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Reported by smatch:
bw_calcs() error: potential null dereference 'data'

Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
---
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(+)

diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
index 4f8a95368ffc..6347712db834 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
+++ b/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);
 
-- 
2.14.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] amd/display: Fix potential null dereference in dce_calcs.c
       [not found] ` <20171108214706.5579-1-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-11-08 22:05   ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2017-11-08 22:05 UTC (permalink / raw)
  To: Ernst Sjöstrand; +Cc: amd-gfx list

On Wed, Nov 8, 2017 at 4:47 PM, Ernst Sjöstrand <ernstp@gmail.com> wrote:
> Reported by smatch:
> bw_calcs() error: potential null dereference 'data'
>
> Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>

Reviewed and pushed.  thanks!

Alex

> ---
> 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(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> index 4f8a95368ffc..6347712db834 100644
> --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> +++ b/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);
>
> --
> 2.14.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-08 22:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-08 21:47 [PATCH v2] amd/display: Fix potential null dereference in dce_calcs.c Ernst Sjöstrand
     [not found] ` <20171108214706.5579-1-ernstp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-11-08 22:05   ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.