[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_Ni9T-jkLrv-s-v1VD8J=VQmyz6S43Na52=1sjdB-uJZA@mail.gmail.com>
Date: Tue, 23 Jul 2019 14:55:12 -0400
From: Alex Deucher <alexdeucher@...il.com>
To: Colin King <colin.king@...onical.com>
Cc: Harry Wentland <harry.wentland@....com>,
Leo Li <sunpeng.li@....com>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
David Zhou <David1.Zhou@....com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
amd-gfx list <amd-gfx@...ts.freedesktop.org>,
Maling list - DRI developers
<dri-devel@...ts.freedesktop.org>, kernel-janitors@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH][next] drm/amd/display: fix a missing null check on a
failed kzalloc
On Tue, Jul 23, 2019 at 10:23 AM Colin King <colin.king@...onical.com> wrote:
>
> From: Colin Ian King <colin.king@...onical.com>
>
> Currently the allocation of config may fail and a null pointer
> dereference on config can occur. Fix this by added a null
> check on a failed allocation of config.
>
> Addresses-Coverity: ("Dereference null return")
> Fixes: c2cd9d04ecf0 ("drm/amd/display: Hook up calls to do stereo mux and dig programming to stereo control interface")
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
Applied. thanks!
Alex
> ---
> drivers/gpu/drm/amd/display/dc/core/dc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
> index 168f4a7dffdf..7cce2baec2af 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
> @@ -1259,6 +1259,8 @@ bool dc_set_generic_gpio_for_stereo(bool enable,
> struct gpio_generic_mux_config *config = kzalloc(sizeof(struct gpio_generic_mux_config),
> GFP_KERNEL);
>
> + if (!config)
> + return false;
> pin_info = dal_gpio_get_generic_pin_info(gpio_service, GPIO_ID_GENERIC, 0);
>
> if (pin_info.mask == 0xFFFFFFFF || pin_info.offset == 0xFFFFFFFF) {
> --
> 2.20.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Powered by blists - more mailing lists