[igt-dev] [PATCH i-g-t 2/2] tools/intel_vbt_decode: check inconsistent sequence element size

Ville Syrjälä ville.syrjala at linux.intel.com
Fri Mar 8 19:09:40 UTC 2019


On Fri, Mar 08, 2019 at 09:01:07PM +0200, Jani Nikula wrote:
> Cross check against the element dumper return value to catch
> inconsistencies.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
>  tools/intel_vbt_decode.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
> index de4cc88a06dd..5f3db808d70d 100644
> --- a/tools/intel_vbt_decode.c
> +++ b/tools/intel_vbt_decode.c
> @@ -1289,7 +1289,13 @@ static const uint8_t *dump_sequence(const uint8_t *data, uint8_t seq_version)
>  			operation_size = *data++;
>  
>  		if (mipi_elem_dump) {
> +			const uint8_t *next = data + operation_size;
> +
>  			data = mipi_elem_dump(data, seq_version);
> +
> +			if (operation_size && next != data)
> +				printf("Error: Inconsistent operation size: %d\n",
> +					operation_size);

I guess non-fatal error is better than the assert I had.

Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
for both

>  		} else if (operation_size) {
>  			/* We have size, skip. */
>  			data += operation_size;
> -- 
> 2.20.1

-- 
Ville Syrjälä
Intel


More information about the igt-dev mailing list