* [patch] Bluetooth: hci_bcm: checking for ERR_PTR instead of NULL
@ 2015-10-22 9:06 Dan Carpenter
2015-10-22 9:33 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-10-22 9:06 UTC (permalink / raw)
To: Marcel Holtmann
Cc: Gustavo Padovan, Johan Hedberg, linux-bluetooth, kernel-janitors
bt_skb_alloc() returns NULL on error, it never returns an ERR_PTR.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 645e66e..4937ecc 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] Bluetooth: hci_bcm: checking for ERR_PTR instead of NULL
2015-10-22 9:06 [patch] Bluetooth: hci_bcm: checking for ERR_PTR instead of NULL Dan Carpenter
@ 2015-10-22 9:33 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2015-10-22 9:33 UTC (permalink / raw)
To: Dan Carpenter
Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth,
kernel-janitors
Hi Dan,
> bt_skb_alloc() returns NULL on error, it never returns an ERR_PTR.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-22 9:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-22 9:06 [patch] Bluetooth: hci_bcm: checking for ERR_PTR instead of NULL Dan Carpenter
2015-10-22 9:33 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).