summaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-12-14 21:55:22 +0800
committerMarcel Holtmann <marcel@holtmann.org>2013-12-14 06:49:14 -0800
commit787949039fcd87b58aabeb494d031912209086ae (patch)
treebf0932e25bc0402fe6ddc089a02d2d44b6de3281 /net/bluetooth
parent05c75e36710f74fc5a7618966b78818ec0d62567 (diff)
downloadlinux-787949039fcd87b58aabeb494d031912209086ae.tar.bz2
Bluetooth: fix return value check
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>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/6lowpan.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 5d3bfd8449b0..d84a3776095e 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -336,8 +336,8 @@ static inline int skbuff_copy(void *msg, int len, int count, int mtu,
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;
@@ -383,8 +383,8 @@ static struct sk_buff *create_pdu(struct l2cap_conn *conn, void *msg,
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;