All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alonso Garrigues <agarrigues@riseup.net>
To: Marcel Holtmann <marcel@holtmann.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Bluetooth: btrtl: fix uninitialized scalar value
Date: Sat, 25 Apr 2026 18:51:42 +0100	[thread overview]
Message-ID: <aez_LiwkX9oS_Nty@lal> (raw)

There is a path where the variable is read uninitialized:
If the opcode switch case is RTL_PATCH_SECURITY_HEADER and key_id is
not set, the if statement condition immediately following the switch
checks an uninitialized rc

Signed-off-by: Alonso Garrigues <agarrigues@riseup.net>
---
 drivers/bluetooth/btrtl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 62f9d4df3a4f..aa0d5af26b5f 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -543,7 +543,7 @@ static int rtlbt_parse_firmware_v2(struct hci_dev *hdev,
 				   unsigned char **_buf)
 {
 	struct rtl_epatch_header_v2 *hdr;
-	int rc;
+	int rc = 0;
 	u8 key_id;
 	u32 num_sections;
 	struct rtl_section *section;
-- 
2.53.0


             reply	other threads:[~2026-04-25 17:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-25 17:51 Alonso Garrigues [this message]
2026-04-25 18:38 ` Bluetooth: btrtl: fix uninitialized scalar value bluez.test.bot

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=aez_LiwkX9oS_Nty@lal \
    --to=agarrigues@riseup.net \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    /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.