]> www.infradead.org Git - users/dwmw2/linux.git/commit
media: mc-device.c: don't memset __user pointer contents
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 27 May 2019 09:31:13 +0000 (05:31 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:28:22 +0000 (07:28 +0200)
commit8cc26f962d484def32a5e5f48492baec1bbe8fa4
tree2e080b7ec38f479b9a647c6d97d20a94f447add1
parent457b9eb243425d4269e5c6797436603bb88859cc
media: mc-device.c: don't memset __user pointer contents

[ Upstream commit 518fa4e0e0da97ea2e17c95ab57647ce748a96e2 ]

You can't memset the contents of a __user pointer. Instead, call copy_to_user to
copy links.reserved (which is zeroed) to the user memory.

This fixes this sparse warning:

SPARSE:drivers/media/mc/mc-device.c drivers/media/mc/mc-device.c:521:16:  warning: incorrect type in argument 1 (different address spaces)

Fixes: f49308878d720 ("media: media_device_enum_links32: clean a reserved field")
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/media-device.c