Re: [PATCH v4] Bluetooth: Fix Device Scan and connection collision

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux