diff options
author | Jani Nikula <jani.nikula@intel.com> | 2021-03-29 16:37:21 +0300 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2021-03-31 15:42:16 +0300 |
commit | f72b1437e9f80abac4d7bf922b83fa5f75941516 (patch) | |
tree | bb7580d7ff110acf86f3cbf4389ae116acf628c5 /drivers/gpu/drm/drm_displayid.c | |
parent | bfd4e1929b5a37dba838c82484e6d8260585ce9d (diff) |
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
Diffstat (limited to 'drivers/gpu/drm/drm_displayid.c')
-rw-r--r-- | drivers/gpu/drm/drm_displayid.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_displayid.c b/drivers/gpu/drm/drm_displayid.c index 902ff6114b68..e0b9e58a9dc8 100644 --- a/drivers/gpu/drm/drm_displayid.c +++ b/drivers/gpu/drm/drm_displayid.c @@ -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; |