Linux bluetooth development
 help / color / mirror / Atom feed
From: "Malovany, Ram" <ramm@ti.com>
To: Johan Hedberg <johan.hedberg@gmail.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: RE: [PATCH v4] Bluetooth: Fix Device Scan and connection collision
Date: Wed, 18 Jul 2012 10:27:55 +0000	[thread overview]
Message-ID: <2683478DEE33CD4DAF508ABCF391F6A40B4AF385@DNCE05.ent.ti.com> (raw)
In-Reply-To: <20120718102027.GA14515@x220.ger.corp.intel.com>

Hi Johan,

> -----Original Message-----
> From: Johan Hedberg [mailto:johan.hedberg@gmail.com]
> Sent: Wednesday, July 18, 2012 1:20 PM
> To: Malovany, Ram
> Cc: linux-bluetooth@vger.kernel.org
> Subject: Re: [PATCH v4] Bluetooth: Fix Device Scan and connection collision
> 
> Hi Ram,
> 
> On Wed, Jul 18, 2012, Malovany, Ram wrote:
> > > >  	e = hci_inquiry_cache_lookup_resolve(hdev, BDADDR_ANY,
> NAME_NEEDED);
> > > > -	if (hci_resolve_name(hdev, e) == 0) {
> > > > +	if (e && hci_resolve_name(hdev, e) == 0) {
> > > >  		e->name_state = NAME_PENDING;
> > > >  		return true;
> > > >  	}
> > >
> > > This missing NULL check is the first fix. You might actually consider
> > > doing:
> > >
> > > 	if (!e)
> > > 		return false;
> > >
> >
> > I didn't want to change the coding in this specific file , as you can
> > see in the function:
> >
> > hci_inquiry_complete_evt() , calling it the same way.
> > But I can changed them both if needed. Do you want me to ?
> 
> The code in hci_inquiry_complete_evt() is a bit different though. There
> you have something else instead of a simple return statement if e is
> NULL (set the discovery state and unlock hdev) so changing that part
> wouldn't really simplify the code much. In your case the code does
> however get a bit simpler since all you need to do is return false.
> 


OK  - will update it according to your comments. Thanks

> Johan


Regards,

Ram

      reply	other threads:[~2012-07-18 10:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18  7:36 [PATCH v4] Bluetooth: Fix Device Scan and connection collision ramm
2012-07-18  8:24 ` Johan Hedberg
2012-07-18  8:50   ` Malovany, Ram
2012-07-18 10:20     ` Johan Hedberg
2012-07-18 10:27       ` Malovany, Ram [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=2683478DEE33CD4DAF508ABCF391F6A40B4AF385@DNCE05.ent.ti.com \
    --to=ramm@ti.com \
    --cc=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