Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1622267ybv; Fri, 21 Feb 2020 00:28:11 -0800 (PST) X-Google-Smtp-Source: APXvYqw+XnIf8jJTCszIVVClAtmgaiWSu8WcgoXqG9voyInjbQMbz4j2hsYP4YeN5gKT1UBGTvJK X-Received: by 2002:a9d:67d7:: with SMTP id c23mr27260492otn.262.1582273691361; Fri, 21 Feb 2020 00:28:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582273691; cv=none; d=google.com; s=arc-20160816; b=al187jlr0+M2PyMIZQThrlcxTyxe9w3uruseR62IayZtsJqQSI2/aQsdHqVQlCbQQa FCUbw+KQUkXA1RV/aXXSOhNrriNi5ZNxhnhp8qCqgaEzOJUaaIx+yiODNzvEDIGHxZ8X hXboh24Q2pXz4zTFWv8NKaNAzUS1bP5JsJgmg4WnTgFYLRyR+00slMD+N95YKF8QBlMN 1gxuvY+aqB+tLUauJuu9gzRn/yGH0qeF7dZR8TLJCnvJvIjDgcuO3SJ19VSv/NioImQ/ GyuMbGCwBcb77wRXzVuPy3cLSvS5HULpx2K+Ztl3J+BdzoZhMn8jmpeo2B+N4LvHBnWk fVdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Aq8P9LIaj2+ZohzyrlN7VtNbXqj46OhyptT9g6w/AVk=; b=e6uaFl95UW5z3/1UGUBPC8f3tJWheuPS1o9dUiLkOxKaIHsdDLrJFZPY2b6jKJbLK8 U0S60Fmptu8K0H/0fRgFoipEO7w7rm/mwdNkjrWBsidF8x5tAIODGwHRuJWBNrKcMgpI V+UxH2DPw26FrwXwh/TRBgd7IF/RcS8/f1YLAX+u/s2ndem0EvW8OUcD3haFJtPs7mUH JIKnlUyKbMtdfAQ4b7jkVJklFuswSUrLyFUyF/MCgIFwm8Nv2JnKfJa2ugn7AOEG0qLO bEf4G5u7Ok9mOTgvVFT9QzqNHRz34xO1BD8lWDAYaBIGOlbxQezxFtOnSZ+Rh71KZSHu CEAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zDIgQ7UX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v25si1108526oth.274.2020.02.21.00.27.59; Fri, 21 Feb 2020 00:28:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zDIgQ7UX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731012AbgBUIWA (ORCPT + 99 others); Fri, 21 Feb 2020 03:22:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:33300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730910AbgBUIVy (ORCPT ); Fri, 21 Feb 2020 03:21:54 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8B2AD24672; Fri, 21 Feb 2020 08:21:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273314; bh=XF+uKzWVjCkasEVsHuILsvLeJGCAQ0To9bSluYuOIk4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zDIgQ7UXW9xs2kikJ8wkeReVSvfJELskVgjdhjeEAIOwcHqdWlBRJBue8X/pZujbP 6A3+OogIjgNDkQHnCcNSxUPoYRJ3KElIbLcMaqoetTxXJ7Co8GjK3XFu7om8I35nF/ o7TjRCMTfAAiJ5sByiXs9jzkzKmy3PXrB1NWSLj0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Ben Skeggs , Sasha Levin Subject: [PATCH 4.19 123/191] drm/nouveau/secboot/gm20b: initialize pointer in gm20b_secboot_new() Date: Fri, 21 Feb 2020 08:41:36 +0100 Message-Id: <20200221072305.591897178@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072250.732482588@linuxfoundation.org> References: <20200221072250.732482588@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 3613a9bea95a1470dd42e4ed1cc7d86ebe0a2dc0 ] 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. Fixes: 923f1bd27bf1 ("drm/nouveau/secboot/gm20b: add secure boot support") Signed-off-by: Dan Carpenter Signed-off-by: Ben Skeggs Signed-off-by: Sasha Levin --- 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 df8b919dcf09b..ace6fefba4280 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.20.1