Skip to contentSkip to conversation

Bluetooth: hci_bcm: checking for ERR_PTR instead of NULL

PATCH In review Dan Carpenter 2 participants 2 messages Oct 22, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: hci_bcm: checking for ERR_PTR instead of NULL

bt_skb_alloc() returns NULL on error, it never returns an ERR_PTR.

drivers/bluetooth/hci_bcm.c +2 -2
index 645e66e..4937ecc 100644
@@ -259,8 +259,8 @@ static int bcm_set_diag(struct hci_dev *hdev, bool enable)
 		return -ENETDOWN;
 
 	skb = bt_skb_alloc(3, GFP_KERNEL);
-	if (IS_ERR(skb))
-		return PTR_ERR(skb);
+	if (!skb)
+		return -ENOMEM;
 
 	*skb_put(skb, 1) = BCM_LM_DIAG_PKT;
 	*skb_put(skb, 1) = 0xf0;