From patchwork Fri Jun 16 09:05:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 108972 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1196349vqr; Fri, 16 Jun 2023 02:28:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4OU7ajv/sSgcosHr0wBISfLpaJHAOyCGSMBrfwscDyzCmgEwCYxZc8L9/eT+Bz14IRzCHN X-Received: by 2002:a05:6358:5157:b0:12b:d09f:221e with SMTP id 23-20020a056358515700b0012bd09f221emr1148764rwj.13.1686907694215; Fri, 16 Jun 2023 02:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686907694; cv=none; d=google.com; s=arc-20160816; b=gow1cvUiX3b70XUmXCNDTdIM/UR/8KacI96sFKsbHcy2CRGvpgr4euhB6GUCxeoL2+ 9Fgg3TIsPvyIaNxBBnGFbr5kpUTW1DbGubLGcj2N5NPktQv6kuEtkfUXV3jZH9PHH2Vq SQWhsESKfjBAgX8i8kk9d6Xp1GrifWgT38oHhJB1DQFgUgmaxfScTMmHAGTVzeIOs2XB irCGsrWKk5GpQ1Zlo/KiQxomw6NBNWvL41wfIYDVWg3YrCPlEIig6eCtVxB7xZIWj7Hr QMRgeVSFEv7B6lIVz2Xp9ALx8rGbO1lG9+guX2h4NauoWHfdO0OvS54N2Q6kOCIplsoL wsQw== 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=NThBu7wVRuKqUM8MrSlOB+KE3sWw46ArBPc/C9yY38c=; b=Q9LeeARJ+91hq8WEEoAemSmghjHdN3Em4EF6IOxxFd2J4zebD6joElbuYzqyVdHGku w8nGyhQHylm9WB4k/yFsTqzWT5Osg3x4J79oA+OX4slWAsdg5NvQ9kkuoIC263+ZenFL c5rPUmCqi2ESGWFZuI7IO92+QHM/jJos0Rv8lWPYJJ+1KC0LW9AdUFpEP49pOxHwqjeQ 0TmNp+nsqdIr0SET9inqKtQRk20dF5CpKBvzVbvPF5giuhLqBAJBovjdFdSI5J54XX5R jG6cIW3UdCk5DcWjH0ajmUu1bJEtkq75lTGJ0Wo+R0fE4IqKRStH9mXHne6+tIftMxXH 5Czg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eyCArWvM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f2-20020a637542000000b005030006a2desi11285563pgn.182.2023.06.16.02.27.59; Fri, 16 Jun 2023 02:28:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=k20201202 header.b=eyCArWvM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241426AbjFPJHw (ORCPT + 99 others); Fri, 16 Jun 2023 05:07:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343975AbjFPJHf (ORCPT ); Fri, 16 Jun 2023 05:07:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8A454C05; Fri, 16 Jun 2023 02:05:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3DF6763088; Fri, 16 Jun 2023 09:05:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1FAFC433C8; Fri, 16 Jun 2023 09:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686906351; bh=k/trZ96PiS/GWyCEHrmskygB7J0jtwXePPp4HjHDZMs=; h=From:To:Cc:Subject:Date:From; b=eyCArWvMCg3UlfRODXgh7mn1uAFFpqGklxVjDsJ3NtFTmFrnqgp4gFdsQtrLMjbJV LWmhz8d6m3mXtdAmx1e1UnYoXAmw9QMBSckNIN4bCOAtUKfTvfJb9hVcLBmj/dWWAf EsURUjUEvbMS0n2C+H/HczxpdGTnEW8nDZ4xlphguV62YaHfaQGeKCGcdlyn3IytfY W9VvWOAhcnWTyYky1PWcHfTYPjE189FHLbFcuvnuM2E6cLEceJI1NLeQZ/X6R9ZH94 pi1ZZBy3JAyVmi9T0br3X+GgqCG4bOPChEVt55xrB0mtlHNK6FeUnF2Wf3WvXEUkk0 ruk/1sAfTIbFA== From: Arnd Bergmann To: Selvin Xavier , Jason Gunthorpe , Leon Romanovsky , Kashyap Desai Cc: Arnd Bergmann , Kalesh AP , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [BUGREPORT] RDMA/bnxt_re: avoid unintialized variable use Date: Fri, 16 Jun 2023 11:05:40 +0200 Message-Id: <20230616090546.2555077-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768850783687626339?= X-GMAIL-MSGID: =?utf-8?q?1768850922385581297?= From: Arnd Bergmann The newly added opcode variable is not initialized anywhere: drivers/infiniband/hw/bnxt_re/qplib_rcfw.c:322:18: error: variable 'opcode' is uninitialized when used here [-Werror,-Wuninitialized] crsqe->opcode = opcode; Not sure what the intention was here, but this is clearly pointless, so instead use 0 in place of the variable. Fixes: bcfee4ce3e013 ("RDMA/bnxt_re: remove redundant cmdq_bitmap") Signed-off-by: Arnd Bergmann --- This is likely not the correct fix, so treat this as a bug report, the patch is what I applied as a temporary workaround in my randconfig tree. --- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c index bb5aebafe1622..8d349d6a633fa 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c @@ -285,7 +285,6 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw, struct pci_dev *pdev; unsigned long flags; u16 cookie; - u8 opcode; u8 *preq; cmdq = &rcfw->cmdq; @@ -319,7 +318,7 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw, crsqe->is_internal_cmd = false; crsqe->is_waiter_alive = true; crsqe->is_in_used = true; - crsqe->opcode = opcode; + crsqe->opcode = 0; crsqe->req_size = __get_cmdq_base_cmd_size(msg->req, msg->req_sz); if (__get_cmdq_base_resp_size(msg->req, msg->req_sz) && msg->sb) {