From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A039C282DD for ; Wed, 8 Jan 2020 23:58:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6CFBF206DB for ; Wed, 8 Jan 2020 23:58:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iAwp+fCZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CFBF206DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6487D6E357; Wed, 8 Jan 2020 23:58:17 +0000 (UTC) Received: from mail-vs1-xe44.google.com (mail-vs1-xe44.google.com [IPv6:2607:f8b0:4864:20::e44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 86E496E357; Wed, 8 Jan 2020 23:58:16 +0000 (UTC) Received: by mail-vs1-xe44.google.com with SMTP id n27so3122046vsa.0; Wed, 08 Jan 2020 15:58:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+nZtXADyrfsNI2t3xLAuGKVhqb37ykNuxCZAZeGw7DM=; b=iAwp+fCZaLvX/muKgM754JeMKkD7idPOE2o7PBHbcHzg8JrSG9zoSSF8EWXOFtA401 dJXpNx32dwiM/LpOeFiZzJj7024cqsQjZzo2+uHMPahH7M6q2DwhDj2xXlPMvBTB+HUX ERou0n5/WG8WT/ChA5nV37bgtXguRvx2iitV2vuHgfmeu28VT/JtjdL/ojyy3Yr8x2/a 9yrz19jR9B86daH/XECUu6lf0GiA3kSGX7M2m/6/IDBixPzjlEkdxQdy0KsBfEBJLuhM Camx9I79Gv0kE74xTlqoDKMcOOuO94fWkejGl6H5xrTUhhUfNyuwy0Ksim/OArakUpsI araw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+nZtXADyrfsNI2t3xLAuGKVhqb37ykNuxCZAZeGw7DM=; b=tzkWz+ggLqCUG69peL3kCJqmu1Li8O2Iaj7PmqNdN9PZpmZ1kulneuODuLmCwK363d qq1Oq/7IJImfkOtMSJ6Ynfvz8q2U4BUad55PVF2xCYZDje1oycNb4uLu7BMOYFo8m4yz amiSdBsNgKTShKThIee53E5LOGmPWDAR/ZTffe9CfiG4a2oamWZHEVdc1aqD4Z/Vd0z6 o+6TfAfRYcPIsTOjJEAABTa10qeJMwJvIYlIM2OnU30XB24rl5VPHMObd3dtMhE4RrcP Fx2LLYlTF6/xGwtitPVrGhv+zgeDOdMq99opDqIK617F0/DO0HJMKk4yoLv2vwJQfMRD 7PXw== X-Gm-Message-State: APjAAAUFfwn9YZXsdiqmbAt2cpwpYgrWU0sic8Ob6yIfdDE/9oKstf1q bkR+kSkkhNfsUgIF1vHLwzIlEBHSvqzchQFCZo0= X-Google-Smtp-Source: APXvYqxMq8zNTpaV3+2pz3t18Kf9P+tFw/MULex1slX6odPImj9OrwG/evNC/zqK9OvL+pybbZSddcdWPVmyb0WaKjQ= X-Received: by 2002:a05:6102:3126:: with SMTP id f6mr4480683vsh.204.1578527895518; Wed, 08 Jan 2020 15:58:15 -0800 (PST) MIME-Version: 1.0 References: <20200108054601.mdwwtcqqpge2iwca@kili.mountain> In-Reply-To: <20200108054601.mdwwtcqqpge2iwca@kili.mountain> From: Ben Skeggs Date: Thu, 9 Jan 2020 09:58:04 +1000 Message-ID: Subject: Re: [PATCH] nouveau/secboot/gm20b: initialize pointer in gm20b_secboot_new() To: Dan Carpenter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , ML nouveau , kernel-janitors@vger.kernel.org, ML dri-devel , Alexandre Courbot , Ben Skeggs Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, 8 Jan 2020 at 15:46, Dan Carpenter wrote: > > We accidentally set "psb" which is a no-op instead of "*psb" so it > generates a static checker warning. We should probably set it before > the first error return so that it's always initialized. You actually don't need to do either, *psb will be NULL already on entry to the function. But removing the assignment in the error path should be done still. Ben. > > Fixes: 923f1bd27bf1 ("drm/nouveau/secboot/gm20b: add secure boot support") > Signed-off-by: Dan Carpenter > --- > Static analysis. I'm not sure how this is called. > > drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c > index df8b919dcf09..ace6fefba428 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c > @@ -108,6 +108,7 @@ gm20b_secboot_new(struct nvkm_device *device, int index, > struct gm200_secboot *gsb; > struct nvkm_acr *acr; > > + *psb = NULL; > acr = acr_r352_new(BIT(NVKM_SECBOOT_FALCON_FECS) | > BIT(NVKM_SECBOOT_FALCON_PMU)); > if (IS_ERR(acr)) > @@ -116,10 +117,8 @@ gm20b_secboot_new(struct nvkm_device *device, int index, > acr->optional_falcons = BIT(NVKM_SECBOOT_FALCON_PMU); > > gsb = kzalloc(sizeof(*gsb), GFP_KERNEL); > - if (!gsb) { > - psb = NULL; > + if (!gsb) > return -ENOMEM; > - } > *psb = &gsb->base; > > ret = nvkm_secboot_ctor(&gm20b_secboot, acr, device, index, &gsb->base); > -- > 2.11.0 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel