Skip to content

Commit f72b143

Browse files
committed
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ä <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/d562dff99ba7c92accb654a99b433bed471e8507.1617024940.git.jani.nikula@intel.com
1 parent bfd4e19 commit f72b143

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/gpu/drm/drm_displayid.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ displayid_iter_block(const struct displayid_iter *iter)
7777
block = (const struct displayid_block *)&iter->section[iter->idx];
7878

7979
if (iter->idx + sizeof(*block) <= iter->length &&
80-
iter->idx + sizeof(*block) + block->num_bytes <= iter->length &&
81-
block->num_bytes > 0)
80+
iter->idx + sizeof(*block) + block->num_bytes <= iter->length)
8281
return block;
8382

8483
return NULL;

0 commit comments

Comments
 (0)