summaryrefslogtreecommitdiff
path: root/drivers/bluetooth/hci_bcm.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-10-22 12:06:09 +0300
committerMarcel Holtmann <marcel@holtmann.org>2015-10-22 11:32:47 +0200
commita1857390e2a626cd44e494968fc1b41891caec66 (patch)
treeaf0e9848bcce33192657915a622c09f98cca899b /drivers/bluetooth/hci_bcm.c
parentc81d555a264bde740adc314f3931046994534106 (diff)
Bluetooth: hci_bcm: checking for ERR_PTR instead of NULL
bt_skb_alloc() returns NULL on error, it never returns an ERR_PTR. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/hci_bcm.c')
-rw-r--r--drivers/bluetooth/hci_bcm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 1aa88dbd6fec..cb852cc750b7 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;