Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2314841rwd; Fri, 16 Jun 2023 02:10:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4azHCyRQWcwnHjqs619TzTtLkyEYn0LHrP2Y9LtdgmYZ91OFP4Vx7Ou0x0QQMvTYUzs/QP X-Received: by 2002:a05:6a20:440d:b0:11a:2908:bb5c with SMTP id ce13-20020a056a20440d00b0011a2908bb5cmr1763832pzb.28.1686906655654; Fri, 16 Jun 2023 02:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686906655; cv=none; d=google.com; s=arc-20160816; b=q9kIE/Qr1n6UAxWy1q6YyuY36+RejXdP5RtaoXHFIo1ki6DKR4YBYgsQBkMGhwInYN AkVHFOklx2tcVGSgcKptnqms3BnVvClREgVUhQ5JEMXIUzdGPoICneqanNv1ah/v5mkl E+sClEGBo8kLqpZpUnLaeldutpE/fXryYu47RQ0TPvM4pIZIhITsa5G2zf0CL7gfbNOC ykoyNH2zb236F7Ut4T4XzKKrAxYavA7TOVrkN+YJB5Mp6XOXHGN15qzYRzXbBenfQgu8 bE7KDh8EgBLTpiEqM52K3HDNRl/fF5S9La/uwPLB2YVe2APcURuwavNraBSWfL/37Ex/ KTWA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o5-20020a637e45000000b0054f993d7f29si8528413pgn.563.2023.06.16.02.10.41; Fri, 16 Jun 2023 02:10:55 -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 S1343965AbjFPJHw (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 Content-Transfer-Encoding: 8bit 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 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) { -- 2.39.2