From: Dan Carpenter Date: Thu, 22 Oct 2015 09:06:09 +0000 (+0300) Subject: Bluetooth: hci_bcm: checking for ERR_PTR instead of NULL X-Git-Tag: v4.14-rc1~4436^2~43^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1857390e2a626cd44e494968fc1b41891caec66;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Marcel Holtmann --- diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 1aa88db..cb852cc 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;