Commit 81044165 authored by Jungo Lin's avatar Jungo Lin Committed by Greg Kroah-Hartman

media: media_device_enum_links32: clean a reserved field

[ Upstream commit f4930887 ]

In v4l2-compliance utility, test MEDIA_IOC_ENUM_ENTITIES
will check whether reserved field of media_links_enum filled
with zero.

However, for 32 bit program, the reserved field is missing
copy from kernel space to user space in media_device_enum_links32
function.

This patch adds the cleaning a reserved field logic in
media_device_enum_links32 function.
Signed-off-by: default avatarJungo Lin <jungo.lin@mediatek.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6fb470ac
...@@ -487,6 +487,7 @@ static long media_device_enum_links32(struct media_device *mdev, ...@@ -487,6 +487,7 @@ static long media_device_enum_links32(struct media_device *mdev,
{ {
struct media_links_enum links; struct media_links_enum links;
compat_uptr_t pads_ptr, links_ptr; compat_uptr_t pads_ptr, links_ptr;
int ret;
memset(&links, 0, sizeof(links)); memset(&links, 0, sizeof(links));
...@@ -498,7 +499,13 @@ static long media_device_enum_links32(struct media_device *mdev, ...@@ -498,7 +499,13 @@ static long media_device_enum_links32(struct media_device *mdev,
links.pads = compat_ptr(pads_ptr); links.pads = compat_ptr(pads_ptr);
links.links = compat_ptr(links_ptr); links.links = compat_ptr(links_ptr);
return media_device_enum_links(mdev, &links); ret = media_device_enum_links(mdev, &links);
if (ret)
return ret;
memset(ulinks->reserved, 0, sizeof(ulinks->reserved));
return 0;
} }
#define MEDIA_IOC_ENUM_LINKS32 _IOWR('|', 0x02, struct media_links_enum32) #define MEDIA_IOC_ENUM_LINKS32 _IOWR('|', 0x02, struct media_links_enum32)
......
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