Re: [PATCH] attrib-server: Fix invalid device access

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

 



Hi Paulo,

On Thu, Jan 03, 2013, Paulo Borges wrote:
> When the device is not found, the channel attach must fail.
> ---
>  src/attrib-server.c |   11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)

Applied though I did make one change first:

> diff --git a/src/attrib-server.c b/src/attrib-server.c
> index 15622e4..4a25743 100644
> --- a/src/attrib-server.c
> +++ b/src/attrib-server.c
> @@ -1131,10 +1131,17 @@ guint attrib_channel_attach(GAttrib *attrib)
>  	ba2str(&channel->dst, addr);
>  
>  	device = adapter_find_device(server->adapter, addr);
> -	if (device == NULL || device_is_bonded(device) == FALSE) {
> +	if (device == NULL) {
> +		error("Device not found");

Never do error() logs with a very generic message like this. Always
provide enough context to figure out what part of the the (big) bluez
code base the error is coming from. Unlike DBG() error() doesn't provide
any automatic context.

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