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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 14992C18E5A for ; Tue, 10 Mar 2020 12:57:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D560620674 for ; Tue, 10 Mar 2020 12:57:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583845060; bh=VKaLgaU5/RVEwROB4TXTES0NH+ISDYx0KNwgIFRpvTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=P2qJRqYC9WhCn//uC17WZAlBJ69hSvxwW9yJvIZ76ExuYY2E4bo9yRN/LrNhCrGip 3T4seqQ1pthHgJ1NY3mperHNeDCHf94Ab0a/wZCsoJQ+RQLAFWjI4I58GDAX3S156f KJilgLQ+2H5aN1lu5vFuIfjkp1oM1YsvRHkZW6eE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728646AbgCJM5k (ORCPT ); Tue, 10 Mar 2020 08:57:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:37278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729801AbgCJM5h (ORCPT ); Tue, 10 Mar 2020 08:57:37 -0400 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 59CBD2253D; Tue, 10 Mar 2020 12:57:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583845056; bh=VKaLgaU5/RVEwROB4TXTES0NH+ISDYx0KNwgIFRpvTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k4CDCn/N70h7NSx5lcWChgeohP7vJWMYlUwapASvzyhsB46keOpdc9n+p9ktsn0P1 KhLrgoh2OVBckGKWkz4BhmwHEohZsAQJDb5JqBVIfHttxxHpnDzxEJV0F82wzT1BEb dUxkvbY7lEXvnRE3vzti1Zt4X3NshgCQ6/4QkQ7o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Christoph Hellwig , Keith Busch , Sasha Levin Subject: [PATCH 5.5 047/189] nvme: Fix uninitialized-variable warning Date: Tue, 10 Mar 2020 13:38:04 +0100 Message-Id: <20200310123644.225610226@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200310123639.608886314@linuxfoundation.org> References: <20200310123639.608886314@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: Keith Busch [ Upstream commit 15755854d53b4bbb0bb37a0fce66f0156cfc8a17 ] gcc may detect a false positive on nvme using an unintialized variable if setting features fails. Since this is not a fast path, explicitly initialize this variable to suppress the warning. Reported-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: Sasha Levin --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index ada59df642d29..a4d8c90ee7cc4 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1165,8 +1165,8 @@ static int nvme_identify_ns(struct nvme_ctrl *ctrl, static int nvme_features(struct nvme_ctrl *dev, u8 op, unsigned int fid, unsigned int dword11, void *buffer, size_t buflen, u32 *result) { + union nvme_result res = { 0 }; struct nvme_command c; - union nvme_result res; int ret; memset(&c, 0, sizeof(c)); -- 2.20.1