From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935109AbdEVWYc (ORCPT ); Mon, 22 May 2017 18:24:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33966 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751942AbdEVWYb (ORCPT ); Mon, 22 May 2017 18:24:31 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A9D19368E4 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=bskeggs@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A9D19368E4 Subject: Re: [PATCH] gpu: drm: nouveau: add null check before pointer dereference To: "Gustavo A. R. Silva" , David Airlie Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20170522191237.GA6240@embeddedgus> From: Ben Skeggs Message-ID: <52f5e84e-7072-4814-275e-1f5a1dba60d2@redhat.com> Date: Tue, 23 May 2017 08:24:26 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170522191237.GA6240@embeddedgus> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 22 May 2017 22:24:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/23/2017 05:12 AM, Gustavo A. R. Silva wrote: > Add null check before dereferencing pointer asyc I've taken the patch into my tree, thanks! Ben. > > Addresses-Coverity-ID: 1397932 > Signed-off-by: Gustavo A. R. Silva > --- > drivers/gpu/drm/nouveau/nv50_display.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c > index a766324..052a60a 100644 > --- a/drivers/gpu/drm/nouveau/nv50_display.c > +++ b/drivers/gpu/drm/nouveau/nv50_display.c > @@ -2107,7 +2107,8 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state) > asyc->set.dither = true; > } > } else { > - asyc->set.mask = ~0; > + if (asyc) > + asyc->set.mask = ~0; > asyh->set.mask = ~0; > } > >