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: v4.0~2533^2~3^2^2~67^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30d3db44bb337321b25344eea3ed6a64ee16fcc8;p=platform%2Fkernel%2Flinux-amlogic.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 3cbb1d1..5ad8b48 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);