lkml.org 
[lkml]   [2014]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] drm/nouveau/clk: fix possible NULL pointer dereference
----- Original Message -----
> From: "Daeseok Youn" <daeseok.youn@gmail.com>
> To: airlied@linux.ie
> Cc: bskeggs@redhat.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
> Sent: Tuesday, 15 April, 2014 11:56:49 AM
> Subject: [PATCH] drm/nouveau/clk: fix possible NULL pointer dereference
>
>
> It need to be checking NULL before dereferencing.
There's no dereference here. It's an address calculation only.

>
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
> drivers/gpu/drm/nouveau/core/subdev/clock/base.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/core/subdev/clock/base.c
> b/drivers/gpu/drm/nouveau/core/subdev/clock/base.c
> index dd62bae..a586d030 100644
> --- a/drivers/gpu/drm/nouveau/core/subdev/clock/base.c
> +++ b/drivers/gpu/drm/nouveau/core/subdev/clock/base.c
> @@ -290,9 +290,9 @@ nouveau_pstate_new(struct nouveau_clock *clk, int idx)
> return 0;
>
> pstate = kzalloc(sizeof(*pstate), GFP_KERNEL);
> - cstate = &pstate->base;
> if (!pstate)
> return -ENOMEM;
> + cstate = &pstate->base;
>
> INIT_LIST_HEAD(&pstate->list);
>
> --
> 1.7.4.4
>
>
>


\
 
 \ /
  Last update: 2014-04-15 09:41    [W:0.041 / U:4.984 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site