drm/displayid: allow data blocks with 0 payload length
The DisplayID specifications explicitly call out 0 as a valid payload length for data blocks. The mere presence of a data block, or the information coded in the block specific data (bits 7:3 in offset 1), may be enough to convey the necessary information. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/d562dff99ba7c92accb654a99b433bed471e8507.1617024940.git.jani.nikula@intel.com
This commit is contained in:
parent
bfd4e1929b
commit
f72b1437e9
@ -77,8 +77,7 @@ displayid_iter_block(const struct displayid_iter *iter)
|
||||
block = (const struct displayid_block *)&iter->section[iter->idx];
|
||||
|
||||
if (iter->idx + sizeof(*block) <= iter->length &&
|
||||
iter->idx + sizeof(*block) + block->num_bytes <= iter->length &&
|
||||
block->num_bytes > 0)
|
||||
iter->idx + sizeof(*block) + block->num_bytes <= iter->length)
|
||||
return block;
|
||||
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user