Thread (2 messages) 2 messages, 2 authors, 13d ago
COOLING13d

[PATCH] Bluetooth: btintel: Drop dead !skb check in btintel_read_version()

From: Jang Ingyu <hidden>
Date: 2026-07-10 20:50:47
Also in: lkml
Subsystem: bluetooth drivers, the rest · Maintainers: Marcel Holtmann, Luiz Augusto von Dentz, Linus Torvalds

From: Ingyu Jang <redacted>

__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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help