提交 a1857390 编写于 作者: D Dan Carpenter 提交者: Marcel Holtmann

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 c81d555a
...@@ -259,8 +259,8 @@ static int bcm_set_diag(struct hci_dev *hdev, bool enable) ...@@ -259,8 +259,8 @@ static int bcm_set_diag(struct hci_dev *hdev, bool enable)
return -ENETDOWN; return -ENETDOWN;
skb = bt_skb_alloc(3, GFP_KERNEL); skb = bt_skb_alloc(3, GFP_KERNEL);
if (IS_ERR(skb)) if (!skb)
return PTR_ERR(skb); return -ENOMEM;
*skb_put(skb, 1) = BCM_LM_DIAG_PKT; *skb_put(skb, 1) = BCM_LM_DIAG_PKT;
*skb_put(skb, 1) = 0xf0; *skb_put(skb, 1) = 0xf0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册