From: Gustavo Padovan <gustavo@padovan.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: padovan@profusion.mobi, linux-bluetooth@vger.kernel.org
Subject: Re: Bluetooth: Fix input device registration
Date: Mon, 14 May 2012 17:02:20 -0300 [thread overview]
Message-ID: <20120514200220.GB23475@joana> (raw)
In-Reply-To: <20120514132955.GA13369@elgon.mountain>
Hi Dan,
* Dan Carpenter <dan.carpenter@oracle.com> [2012-05-14 16:30:03 +0300]:
> Hi, I am working on some new stuff for Smatch and sending bug reports
> on potential bugs I find as I go.
>
> ----
> This is a semi-automatic email about new static checker warnings.
>
> The patch 3415a5fdde71: "Bluetooth: Fix input device registration"
> from Oct 6, 2011, leads to the following Smatch complaint:
>
> net/bluetooth/hidp/core.c:1072 hidp_add_connection()
> error: we previously assumed 'session->input' could be null (see line 1049)
>
> net/bluetooth/hidp/core.c
> 1046 if (session->hid) {
> 1047 vendor = session->hid->vendor;
> 1048 product = session->hid->product;
> 1049 } else if (session->input) {
> 1050 vendor = session->input->id.vendor;
> 1051 product = session->input->id.product;
> 1052 } else {
> ^^^^^^^^
> If we hit this else clause then "session->input" and "session->hid" are
> both NULL.
Actually both can never be NULL at the same time here. If after call
hdip_setup_input() session->input is still NULL, the we goto purge and skip
the code below.
Gustavo
prev parent reply other threads:[~2012-05-14 20:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-14 13:30 Bluetooth: Fix input device registration Dan Carpenter
2012-05-14 20:02 ` Gustavo Padovan [this message]
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=20120514200220.GB23475@joana \
--to=gustavo@padovan.org \
--cc=dan.carpenter@oracle.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=padovan@profusion.mobi \
/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