From: Johan Hedberg Date: Thu, 12 Dec 2013 07:53:21 +0000 (+0200) Subject: Bluetooth: Fix test for lookup_dev return value X-Git-Tag: next-20131213~53^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=30d3db44bb337321b25344eea3ed6a64ee16fcc8;p=karo-tx-linux.git 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 Signed-off-by: Marcel Holtmann --- 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);