Commit f72b1437 authored by Jani Nikula's avatar Jani Nikula

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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/d562dff99ba7c92accb654a99b433bed471e8507.1617024940.git.jani.nikula@intel.com
parent bfd4e192
...@@ -77,8 +77,7 @@ displayid_iter_block(const struct displayid_iter *iter) ...@@ -77,8 +77,7 @@ displayid_iter_block(const struct displayid_iter *iter)
block = (const struct displayid_block *)&iter->section[iter->idx]; block = (const struct displayid_block *)&iter->section[iter->idx];
if (iter->idx + sizeof(*block) <= iter->length && if (iter->idx + sizeof(*block) <= iter->length &&
iter->idx + sizeof(*block) + block->num_bytes <= iter->length && iter->idx + sizeof(*block) + block->num_bytes <= iter->length)
block->num_bytes > 0)
return block; return block;
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment