Re: [PATCH] PCI/VPD: Add simple sanity check to pci_vpd_size()

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

 



Hi Heiner,

[...]
> Instead let's add a simple sanity check on the number of found tags.
> A VPD image conforming to the PCI spec can have max. 4 tags:
> id string, ro section, rw section, end tag.

It's always nice to check if something is compliant with the specification.

Would you be able to either cite this part of the official specification or
mention where to find it?  Like we do in other such changes related to some
official standards, mainly for posterity to benefit others that might look
at this commit in the future.

[...]
> +		/* We can have max 4 tags: STRING_ID, RO, RW, END */
> +		if (++num_tags > 4)
> +			goto error;

Do we want to let someone know that their device (or a device they might
have in the system) has non-compliant and/or malformed VPD which is why we
decided to return an error?  I wonder if this would help with
troubleshooting or just simply had some informative value.  So perhaps
a warning or debug level message?  What do you think?

Reviewed-by: Krzysztof Wilczyński <kw@xxxxxxxxx>

	Krzysztof



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux