In case of error, the function bt_skb_alloc() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
count = min_t(unsigned int, mtu, len);
tmp = bt_skb_alloc(count, GFP_ATOMIC);
- if (IS_ERR(tmp))
- return PTR_ERR(tmp);
+ if (!tmp)
+ return -ENOMEM;
*frag = tmp;
BT_DBG("conn %p len %zu mtu %d count %d", conn, len, conn->mtu, count);
skb = bt_skb_alloc(count + L2CAP_HDR_SIZE, GFP_ATOMIC);
- if (IS_ERR(skb))
- return skb;
+ if (!skb)
+ return ERR_PTR(-ENOMEM);
skb->priority = priority;