Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp590430pxb; Mon, 16 Aug 2021 12:25:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEIuQQqj8FPwCXKizY1LO0XTTXmdCq+hxCq0QZ2I/h5atYRy0MvNVORnr7z3GDB15tS1UE X-Received: by 2002:a92:cb52:: with SMTP id f18mr299688ilq.120.1629141916763; Mon, 16 Aug 2021 12:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629141916; cv=none; d=google.com; s=arc-20160816; b=b6MEM2umQRszWRRZm+qODp0oNWYuouQH3KzmP3pKXKisl6iVlv20htLRL35Es1gx09 ty9BiH+lnlSDjMEE7dRzzTwnA7GK4L0TbJdnU+i5COIl6Yvv69T+9tAEYe3bubkydvaO Aa1pdjxy1gE1dmbpvQgguNnrZifj1IKiKjQbDHuom+9WRu75TCtuNKub9NVSklEd0vjh uSgHJlPurOtwKJwYgeqTowdy1LDaqbL10BoI7OXb3ajPOx4sRa6Cvny7TRLqjXRrzlQK vr3mXAxHwNgO7mCtiym8j139+/6mMVG51N9/zFGnH5ikNVdFu+GtMWD/7pz3Atgolp4V gKXA== 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=tWj4QoGgsZXwBjPcpg0s+AqXSiipgAeGsG36glfrsNA=; b=m8Z1I9eB1Tjs1l9ns83LRtozQICW+0iAsi2cXaCjV72FIPMfCiV/8vO/svugfbG3oN Pmh/PSfLoy1zDTfZbhqww3WpEnejzgFeLQVYi0zHPpL4zZ7Lv6HPQOAB0I6vlC5c77PF 5FBBYWzZfhBWQ5txJrGVfCO0DwtUQcgZ9YKm5gjt2EvofiQlm29fa6eOHClQV8spu+fv QFGP3X0HjLyY5GJgxC8/63DHn6DW32/xhapX0CMcPYDGvDm6KWsS8BRkCTKlSydGqZqb LZz7hFp2pEx6BM68XB953eAQAyB9RvC9nDWTbTlKdUUdfZNhZ5tFirzXhwZ8Vp9Mv23r vkBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N3BiG631; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v9si104211ilu.149.2021.08.16.12.24.56; Mon, 16 Aug 2021 12:25:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N3BiG631; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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 S231207AbhHPTYE (ORCPT + 99 others); Mon, 16 Aug 2021 15:24:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48312 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231143AbhHPTYD (ORCPT ); Mon, 16 Aug 2021 15:24:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629141811; 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=tWj4QoGgsZXwBjPcpg0s+AqXSiipgAeGsG36glfrsNA=; b=N3BiG631OtQqn6ToBC8RF/TRSvuWf6wzzqUUFIFXZTAAx27oJiGwJRti6gDNi1lJuNyOJJ 7mo3DD8YkCOTlQgbv5O58RNdawvZIJ85LZfEaj7Yx2YtiO9dmaEPJHAh9gEuLUZ4z5Lesz bUgAkIVfTiXzeYFAA6d+kAGHaLnAUfU= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-224-vTHCaV5UN8Kub17Rnp2Ljg-1; Mon, 16 Aug 2021 15:23:30 -0400 X-MC-Unique: vTHCaV5UN8Kub17Rnp2Ljg-1 Received: by mail-qk1-f197.google.com with SMTP id h186-20020a37b7c30000b02903b914d9e335so13827731qkf.17 for ; Mon, 16 Aug 2021 12:23:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tWj4QoGgsZXwBjPcpg0s+AqXSiipgAeGsG36glfrsNA=; b=GHUt/gIN1Z5oJYcAn5TLTkjS2Si5WCUV+voklB5mZk0JugomtoDA9hnJ/qcoU+Dv1d quMN7QiA0x6aMbZyrNFaaBYMwahWx3tlmn+bLPmO8tOUeQ4o5kME3v7V7WSylrS9wj4l Oiyozh10b/U1tZ2Bh3CG/gIUdjngmsEPQyaLWS0hL/DV/fg+Yy+j8wf7qtwEeYEUNnfY u0iwzWqEmJ/ttfBR/X5fEe3BSddvpYypXENFe1pwFKpacthAqskLyjoLqrG3L+2GSzVR ObM4bYmDTetE5pic8C0EqjUSVOrlrxWy95fGMOifA3sfTKyI7TlZyThDtfpHswADqgW0 A83A== X-Gm-Message-State: AOAM530Bb4YWR5WG1Y60J/qu43m+4RjsrlfO5T354w6tx4osZY0TIZYY NtMJBtHaiGSMkRrIoZNewlmY/qVLjnRIZ1Eae8zbyeV5jjCxAm36aSPACAkacSgZgXYOKxEyh5Y fDW1i6XG0Dj3XCAGoxlGS69xV X-Received: by 2002:a05:6214:aa8:: with SMTP id ew8mr312662qvb.43.1629141810009; Mon, 16 Aug 2021 12:23:30 -0700 (PDT) X-Received: by 2002:a05:6214:aa8:: with SMTP id ew8mr312643qvb.43.1629141809795; Mon, 16 Aug 2021 12:23:29 -0700 (PDT) Received: from localhost.localdomain.com (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id y124sm55002qke.70.2021.08.16.12.23.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Aug 2021 12:23:29 -0700 (PDT) From: trix@redhat.com To: brijesh.singh@amd.com, thomas.lendacky@amd.com, john.allen@amd.com, herbert@gondor.apana.org.au, davem@davemloft.net, ashish.kalra@amd.com, rientjes@google.com Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Tom Rix Subject: [PATCH] crypto: initialize error variable Date: Mon, 16 Aug 2021 12:23:12 -0700 Message-Id: <20210816192312.1291783-1-trix@redhat.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Tom Rix Static analysis reports this problem sev-dev.c:1094:19: warning: The left operand of '==' is a garbage value if (rc && (error == SEV_RET_SECURE_DATA_INVALID)) { ~~~~~ ^ The error variable may not be set by the call to sev_platform_init(). So initialize error to SEV_RET_SUCCESS. Fixes: 1d55fdc85799 ("crypto: ccp - Retry SEV INIT command in case of integrity check failure.") Signed-off-by: Tom Rix --- 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 2ecb0e1f65d8d..b2b9f0f4daf2d 100644 --- a/drivers/crypto/ccp/sev-dev.c +++ b/drivers/crypto/ccp/sev-dev.c @@ -1065,7 +1065,7 @@ void sev_pci_init(void) { struct sev_device *sev = psp_master->sev_data; struct page *tmr_page; - int error, rc; + int error = SEV_RET_SUCCESS, rc; if (!sev) return; -- 2.26.3