Linux bluetooth development
 help / color / mirror / Atom feed
From: johan.hedberg@gmail.com
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 2/2] Bluetooth: Fix test for lookup_dev return value
Date: Thu, 12 Dec 2013 09:53:21 +0200	[thread overview]
Message-ID: <1386834801-1635-2-git-send-email-johan.hedberg@gmail.com> (raw)
In-Reply-To: <1386834801-1635-1-git-send-email-johan.hedberg@gmail.com>

From: Johan Hedberg <johan.hedberg@intel.com>

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>
---
 net/bluetooth/6lowpan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
1.8.4.2


  reply	other threads:[~2013-12-12  7:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-12  7:53 [PATCH 1/2] Bluetooth: Add missing 6lowpan.h include johan.hedberg
2013-12-12  7:53 ` johan.hedberg [this message]
2013-12-12  8:01   ` [PATCH 2/2] Bluetooth: Fix test for lookup_dev return value Marcel Holtmann
2013-12-12  8:00 ` [PATCH 1/2] Bluetooth: Add missing 6lowpan.h include Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386834801-1635-2-git-send-email-johan.hedberg@gmail.com \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox