Re: [PATCH 6/6] android: Do not dereference possible NULL pointer

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

 



Hi Andrei,

On Tue, Nov 26, 2013, Andrei Emeltchenko wrote:
> eir might be NULL, do not derefernce it in debug and print instead
> pointer.
> ---
>  android/bluetooth.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/android/bluetooth.c b/android/bluetooth.c
> index aa684bd..77ce519 100644
> --- a/android/bluetooth.c
> +++ b/android/bluetooth.c
> @@ -916,8 +916,8 @@ static void mgmt_device_found_event(uint16_t index, uint16_t length,
>  	flags = btohl(ev->flags);
>  
>  	ba2str(&ev->addr.bdaddr, addr);
> -	DBG("hci%u addr %s, rssi %d flags 0x%04x eir_len %u eir %u",
> -				index, addr, ev->rssi, flags, eir_len, *eir);
> +	DBG("hci%u addr %s, rssi %d flags 0x%04x eir_len %u eir %p",
> +				index, addr, ev->rssi, flags, eir_len, eir);
>  
>  	confirm_name = flags & MGMT_DEV_FOUND_CONFIRM_NAME;

I'd just remove printing the eir pointer value completely since it
doesn't really give us anything. Since this is such a trivial thing I
pushed a patch to fix this myself.

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