linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: waldemar.rymarkiewicz@tieto.com
Cc: linux-bluetooth@vger.kernel.org
Subject: re: Bluetooth: Add secure flag for mgmt_pin_code_req
Date: Wed, 21 Sep 2011 10:08:04 +0300	[thread overview]
Message-ID: <20110921070804.GA5982@elgon.mountain> (raw)

Hello Waldemar Rymarkiewicz,

This is a semi-automatic email about new static checker warnings.

Thu Apr 28 12:07:59 2011 +0200
a770bb5aea84: "Bluetooth: Add secure flag for mgmt_pin_code_req"

Leads to the following Smatch complaint:
net/bluetooth/hci_event.c +2189 hci_pin_code_request_evt()
	 error: we previously assumed 'conn' could be null (see line 2177)

net/bluetooth/hci_event.c
  2176		conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
  2177		if (conn && conn->state == BT_CONNECTED) {
                    ^^^^
conn can be NULL.

  2178			hci_conn_hold(conn);
  2179			conn->disc_timeout = HCI_PAIRING_TIMEOUT;
  2180			hci_conn_put(conn);
  2181		}
  2182	
  2183		if (!test_bit(HCI_PAIRABLE, &hdev->flags))
  2184			hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY,
  2185						sizeof(ev->bdaddr), &ev->bdaddr);
  2186		else if (test_bit(HCI_MGMT, &hdev->flags)) {
  2187			u8 secure;
  2188	
  2189			if (conn->pending_sec_level == BT_SECURITY_HIGH)
                            ^^^^^^^^^^^^^^^^^^^^^^^
dereferenced unconditionally here.

  2190				secure = 1;
  2191			else

regards,
dan carpenter

             reply	other threads:[~2011-09-21  7:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-21  7:08 Dan Carpenter [this message]
2011-09-21 13:17 ` Bluetooth: Add secure flag for mgmt_pin_code_req Rymarkiewicz Waldemar
2011-09-22  5:58 ` [PATCH] Bluetooth: Fix possible NULL pointer dereference Waldemar Rymarkiewicz
2011-09-22  9:51   ` Marcel Holtmann
2011-09-22 10:28     ` Rymarkiewicz Waldemar
2011-09-22 10:58       ` 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=20110921070804.GA5982@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=waldemar.rymarkiewicz@tieto.com \
    /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;
as well as URLs for NNTP newsgroup(s).