Skip to content

Commit

Permalink
Bluetooth: hci_bcm: checking for ERR_PTR instead of NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Marcel Holtmann committed Oct 22, 2015
1 parent c81d555 commit a185739
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/bluetooth/hci_bcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a185739

Please sign in to comment.