* [PATCH] Bluetooth: btintel: Drop dead !skb check in btintel_read_version()
@ 2026-07-10 20:30 Jang Ingyu
2026-07-10 21:47 ` bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Jang Ingyu @ 2026-07-10 20:30 UTC (permalink / raw)
To: Marcel Holtmann, Luiz Augusto von Dentz; +Cc: linux-bluetooth, linux-kernel
From: Ingyu Jang <ingyujang25@korea.ac.kr>
__hci_cmd_sync() returns either an ERR_PTR or a valid non-NULL skb;
its internal NULL cases are converted to ERR_PTR(-ENODATA) before
return (net/bluetooth/hci_sync.c). After the preceding IS_ERR(skb)
filter, skb is guaranteed to be a valid non-NULL pointer, so the
!skb disjunct in the subsequent length check never triggers.
Drop the dead !skb subexpression; the skb->len size mismatch check
remains the real guard.
Signed-off-by: Ingyu Jang <ingyujang25@korea.ac.kr>
---
drivers/bluetooth/btintel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 5e9cac090bd8f..5361c1a8c8452 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -460,7 +460,7 @@ int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver)
return PTR_ERR(skb);
}
- if (!skb || skb->len != sizeof(*ver)) {
+ if (skb->len != sizeof(*ver)) {
bt_dev_err(hdev, "Intel version event size mismatch");
kfree_skb(skb);
return -EILSEQ;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-10 21:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10 20:30 [PATCH] Bluetooth: btintel: Drop dead !skb check in btintel_read_version() Jang Ingyu
2026-07-10 21:47 ` bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox