Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8086891rwl; Tue, 10 Jan 2023 08:54:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXuZLqsRiR5AjU7kBbxyAR5ygoLdpXUQYDx5uZMvG/0lQIfQi0Np77d0TradfD5KuvDJX1pn X-Received: by 2002:a05:6402:414:b0:495:77a9:f108 with SMTP id q20-20020a056402041400b0049577a9f108mr18980838edv.39.1673369691380; Tue, 10 Jan 2023 08:54:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673369691; cv=none; d=google.com; s=arc-20160816; b=WmUy422zOvGLfG1Rt1VB8O4ovRlKL8dTfyo8nTGWIzQctUgbjw28zF6NOViiJd7qPC ipdb1EEM0mYS7foPwJAivV5+N+0o1KFfetbmNbRmVLLo2LX7UjZmNeSkJ0XzzxXaZ+G9 ArthMymGLsnWSBUHiNbTEdOzJx/vnqqXmewASXgGXnX4TfXzVoB4lSTYzYuIC0m1/05p XFAMVDMKpuPXotcthagz+MaJN5YgfiD7jVRspU9fF1Ps1uWAG0hmNHWIYgNFu7Mgx5Bv EvcD57dReYfKR14Kp0bbpG079R1i8GEo4MkpCIb5kng9w8dHaOAzI8BjckxJ4DK1maM0 XOpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Kup4HOCIEU1szEBLKhvEmi75KAA9Nb/HeMnvSYwk5j0=; b=LQxaFhh7Gd9B1W2DJptNIaNzvIchJUmjehMbanL3X3tbm0MmbaBd3f0QILm8rDEA1j nuS4O8QboUloHxo7F8Pn/XEaaD1D19t2mon9oR8poAVGlhlv5Km2NGp8bzreZ4Fu2m8P wQjwBW8J0LA27i1KVFuG7gqJ9SdIyZDURfOdzx+4hc75H+5fothAew3IRUE7Arz5e9Yf 15rcaZmE7vjsHrxQixhyNb8CflVjOS7lM+BCrQaqXmzQrJ3Bcsu3J9kRwBbzyoKkYJ0L nhIgH12hwebe5MjHkYOORnMNPdnnFKo0gD4C/ND1SNifdKTHGxp9Z8P1yxapnYMTs5Ax mHeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LI4G1rCU; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020a056402350c00b0048c5062f15bsi14310825edd.386.2023.01.10.08.54.28; Tue, 10 Jan 2023 08:54:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LI4G1rCU; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239059AbjAJQyY (ORCPT + 99 others); Tue, 10 Jan 2023 11:54:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239005AbjAJQyO (ORCPT ); Tue, 10 Jan 2023 11:54:14 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C50BD193C9 for ; Tue, 10 Jan 2023 08:53:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673369606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Kup4HOCIEU1szEBLKhvEmi75KAA9Nb/HeMnvSYwk5j0=; b=LI4G1rCUuToZQyYr8LY6EFzljUELpDzV6Jf3cKwIaT6Dy2R855uSURPVJrXbexTXjQ+1A6 zzrkWnz5mmCEVDsRgFUMv09v5zgr07mPCqUlnUAR8IMQ9t+7rGXsrmKZfiQt3ivcoZSj0K Y2sH/Sjw8WxTYciG7qt0u9sfqx4V0Rg= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-484-tCzbOWyrPMCyws-Kg8XjSw-1; Tue, 10 Jan 2023 11:53:21 -0500 X-MC-Unique: tCzbOWyrPMCyws-Kg8XjSw-1 Received: by mail-qt1-f200.google.com with SMTP id ay40-20020a05622a22a800b003a978b3019cso5786749qtb.16 for ; Tue, 10 Jan 2023 08:53:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Kup4HOCIEU1szEBLKhvEmi75KAA9Nb/HeMnvSYwk5j0=; b=4EGaAvR7VVOFg+YeuP6yJQxJ4BNuJwR/7D3Cqy6a9SwwW76Lx4Cb91G3YFudnzh/0V ZYsKXKfK/HAL+B70xYMbH9RW/8n10b//huqewgvb6G6/bn6j5aW18X52TficFB/mEDQD 4Mo+bYEN7dvYX1b2HZDkuuNrscaY096GlDB8LuV1eaOrULDUn098XTdCUXMidakutU8c AlJ12X79b9DrdiZw+Rihmhs5s9Dtu2jmvu3jbkFakR3Pg/UUceo6wLluTQPe4OczmJi3 131lU8PCCjlI0QvWqL7E88NdVuZmQrdsfWMM6hvaCwOfHkioMado78GmIcyhqo72ojj6 3phA== X-Gm-Message-State: AFqh2koxr0bgv4zpcpG9Tsr4amWgX8lhFTk/2V/YcIm+khToNi438TgT 9B7BXuOWQ1MH/FdxPRldKRHywKC8moW85+GaQo74Xxyk6RImhTbFzaqcnDsk+S9FHWFantdeYkj a/u6+D3XfrHKOgWFC9+72aMEV X-Received: by 2002:a05:622a:1f06:b0:3ae:55ba:8392 with SMTP id ca6-20020a05622a1f0600b003ae55ba8392mr8544546qtb.32.1673369600684; Tue, 10 Jan 2023 08:53:20 -0800 (PST) X-Received: by 2002:a05:622a:1f06:b0:3ae:55ba:8392 with SMTP id ca6-20020a05622a1f0600b003ae55ba8392mr8544521qtb.32.1673369600490; Tue, 10 Jan 2023 08:53:20 -0800 (PST) Received: from dell-per740-01.7a2m.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id y19-20020a05620a44d300b006fba44843a5sm7452833qkp.52.2023.01.10.08.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:53:20 -0800 (PST) From: Tom Rix To: brijesh.singh@amd.com, thomas.lendacky@amd.com, john.allen@amd.com, herbert@gondor.apana.org.au, davem@davemloft.net, nathan@kernel.org, ndesaulniers@google.com Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Tom Rix Subject: [PATCH v2] crypto: ccp: initialize error Date: Tue, 10 Jan 2023 11:53:16 -0500 Message-Id: <20230110165316.2870300-1-trix@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org clang static analysis reports this problem drivers/crypto/ccp/sev-dev.c:1347:3: warning: 3rd function call argument is an uninitialized value [core.CallAndMessage] dev_err(sev->dev, "SEV: failed to INIT error %#x, rc %d\n", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __sev_platform_init_locked() can return without setting the error parameter, causing the dev_err() to report a garbage value. Fixes: 200664d5237f ("crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support") Signed-off-by: Tom Rix --- v2 : cleanup commit log --- drivers/crypto/ccp/sev-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c index 56998bc579d6..643cccc06a0b 100644 --- a/drivers/crypto/ccp/sev-dev.c +++ b/drivers/crypto/ccp/sev-dev.c @@ -1307,7 +1307,7 @@ EXPORT_SYMBOL_GPL(sev_issue_cmd_external_user); void sev_pci_init(void) { struct sev_device *sev = psp_master->sev_data; - int error, rc; + int error = 0, rc; if (!sev) return; -- 2.27.0