RE: [PATCH] eir: Keep parsed eir_data on error

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

 



> -----Original Message-----
> From: Ganir, Chen
> Sent: Wednesday, May 09, 2012 12:21 PM
> To: linux-bluetooth@xxxxxxxxxxxxxxx
> Cc: Ganir, Chen
> Subject: [PATCH] eir: Keep parsed eir_data on error
> 
> From: Chen Ganir <chen.ganir@xxxxxx>
> 
> Do not discard already parsed eir_data on eir data length error.
> Data corruption may occur, but this does not mean that we need
> to ignore already parsed valid eir data
> ---
>  src/eir.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/eir.c b/src/eir.c
> index 310cd53..f2f6992 100644
> --- a/src/eir.c
> +++ b/src/eir.c
> @@ -114,10 +114,9 @@ int eir_parse(struct eir_data *eir, uint8_t
> *eir_data, uint8_t eir_len)
> 
>  		len += field_len + 1;
> 
> -		/* Bail out if got incorrect length */
> +		/* Do not continue EIR Data parsing if got incorrect length
> */
>  		if (len > eir_len) {
> -			eir_data_free(eir);
> -			return -EINVAL;
> +			return 0;
>  		}
> 
>  		data_len = field_len - 1;
> --
> 1.7.0.4

Ping ?

BR,
Chen Ganir.

--
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