From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Skeggs Subject: Re: [patch] drm/nouveau: testing the wrong variable Date: Tue, 18 Oct 2011 16:20:48 +1000 Message-ID: <1318918848.2567.0.camel@nisroch> References: <20111018060751.GB27732@elgon.mountain> Reply-To: bskeggs@redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id 401929E7CA for ; Mon, 17 Oct 2011 23:19:33 -0700 (PDT) In-Reply-To: <20111018060751.GB27732@elgon.mountain> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Dan Carpenter Cc: Emil Velikov , kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org, Martin Peres , Roy Spliet List-Id: dri-devel@lists.freedesktop.org On Tue, 2011-10-18 at 09:07 +0300, Dan Carpenter wrote: > memtimings is a valid pointer here, the intent was to test for > kcalloc() failure. I've queued it, thanks! Ben. > > Signed-off-by: Dan Carpenter > > diff --git a/drivers/gpu/drm/nouveau/nouveau_perf.c b/drivers/gpu/drm/nouveau/nouveau_perf.c > index 9f178aa..33d03fb 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_perf.c > +++ b/drivers/gpu/drm/nouveau/nouveau_perf.c > @@ -239,7 +239,7 @@ nouveau_perf_init(struct drm_device *dev) > if(version == 0x15) { > memtimings->timing = > kcalloc(entries, sizeof(*memtimings->timing), GFP_KERNEL); > - if(!memtimings) { > + if (!memtimings->timing) { > NV_WARN(dev,"Could not allocate memtiming table\n"); > return; > }