Re: [PATCH] Bluetooth: Fix bug with filter in service discovery optimization

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

 



Hi Marcel,

On Wed, Dec 17, 2014, Marcel Holtmann wrote:
> The optimization for filtering out extended inquiry results, advertising
> reports or scan response data based on provided UUID list has a logic
> bug. In case no match is found in the advertising data, the scan
> response is ignored and not checked against the filter. This will lead
> to events being filtered wrongly.
> 
> Change the code to actually only drop the events when the scan response
> data is not present. If it is present, it needs to be checked against
> the provided filter.
> 
> The patch is a bit more complex than it needs to be. That is because
> it also fixes this compiler warning that some gcc versions produce.
> 
>   CC      net/bluetooth/mgmt.o
> net/bluetooth/mgmt.c: In function ‘mgmt_device_found’:
> net/bluetooth/mgmt.c:7028:7: warning: ‘match’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   bool match;
>        ^
> 
> It seems that gcc can not clearly figure out the context of the match
> variable. So just change the branches for the extended inquiry response
> and advertising data around so that it is clear.
> 
> Reported-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Signed-off-by: Marcel Holtmann <marcel@xxxxxxxxxxxx>
> ---
>  net/bluetooth/mgmt.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)

Applied to the bluetooth.git tree. Thanks.

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