All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Selvin Xavier <selvin.xavier@broadcom.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
	Kashyap Desai <kashyap.desai@broadcom.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Kalesh AP <kalesh-anakkur.purayil@broadcom.com>,
	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	[thread overview]
Message-ID: <20230616090546.2555077-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

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 <arnd@arndb.de>
---
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


             reply	other threads:[~2023-06-16  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16  9:05 Arnd Bergmann [this message]
2023-06-16  9:11 ` [PATCH] [BUGREPORT] RDMA/bnxt_re: avoid unintialized variable use Selvin Xavier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230616090546.2555077-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --cc=jgg@ziepe.ca \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=kashyap.desai@broadcom.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=selvin.xavier@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.