diff options
author | Tom Rix <trix@redhat.com> | 2021-08-12 20:01:46 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-08 15:23:16 +0300 |
commit | 12cb301cc5cb681c0ada80dc070bf3e1345e7373 (patch) | |
tree | e6fc84fa05042d43f614128069600a40cb534ede /drivers/media/i2c/adv7511-v4l2.c | |
parent | 0d05a58ea3b945491a36b4bc4d925903224141ea (diff) | |
download | linux-12cb301cc5cb681c0ada80dc070bf3e1345e7373.tar.xz |
media: video/hdmi: handle short reads of hdmi info frame.
[ Upstream commit 4a92fc6e55da5b87cecb572275deaff6ac9dd27e ]
Calling hdmi_infoframe_unpack() with static sizeof(buffer) skips all
the size checking done later in hdmi_infoframe_unpack(). A better
value is the amount of data read into buffer.
Fixes: 480b8b3e42c3 ("video/hdmi: Pass buffer size to infoframe unpack functions")
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/media/i2c/adv7511-v4l2.c')
-rw-r--r-- | drivers/media/i2c/adv7511-v4l2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/i2c/adv7511-v4l2.c b/drivers/media/i2c/adv7511-v4l2.c index 41f4e749a859..2217004264e4 100644 --- a/drivers/media/i2c/adv7511-v4l2.c +++ b/drivers/media/i2c/adv7511-v4l2.c @@ -544,7 +544,7 @@ static void log_infoframe(struct v4l2_subdev *sd, const struct adv7511_cfg_read_ buffer[3] = 0; buffer[3] = hdmi_infoframe_checksum(buffer, len + 4); - if (hdmi_infoframe_unpack(&frame, buffer, sizeof(buffer)) < 0) { + if (hdmi_infoframe_unpack(&frame, buffer, len + 4) < 0) { v4l2_err(sd, "%s: unpack of %s infoframe failed\n", __func__, cri->desc); return; } |