summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/6lowpan.c
diff options
context:
space:
mode:
authorJohan Hedberg2013-12-12 08:53:21 +0100
committerMarcel Holtmann2013-12-12 08:59:21 +0100
commit30d3db44bb337321b25344eea3ed6a64ee16fcc8 (patch)
tree7ae26e0b386cec6716fde50428404e4258905312 /net/bluetooth/6lowpan.c
parentBluetooth: Add missing 6lowpan.h include (diff)
downloadkernel-qcow2-linux-30d3db44bb337321b25344eea3ed6a64ee16fcc8.tar.gz
kernel-qcow2-linux-30d3db44bb337321b25344eea3ed6a64ee16fcc8.tar.xz
kernel-qcow2-linux-30d3db44bb337321b25344eea3ed6a64ee16fcc8.zip
Bluetooth: Fix test for lookup_dev return value
The condition wouldn't have previously caused -ENOENT to be returned if dev was NULL. The proper condition should be if (!dev || !dev->netdev). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/6lowpan.c')
-rw-r--r--net/bluetooth/6lowpan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 3cbb1d14c304..5ad8b483efa3 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -330,7 +330,7 @@ int bt_6lowpan_recv(struct l2cap_conn *conn, struct sk_buff *skb)
return -ENOENT;
dev = lookup_dev(conn);
- if (dev && !dev->netdev)
+ if (!dev || !dev->netdev)
return -ENOENT;
err = recv_pkt(skb, dev->netdev, conn);