]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: vimc: zero the media_device on probe
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Fri, 8 Mar 2019 13:02:26 +0000 (08:02 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:45:19 +0000 (06:45 -0700)
commit598e10c56433eaf109c87c4c66892597af8d83c6
tree8ecbd38525c78a21a84a701791b76bb46d34be66
parentc5523bf8e2ded121c32b382c281a127c1cef809c
media: vimc: zero the media_device on probe

[ Upstream commit f74267b51cb36321f777807b2e04ca02167ecc08 ]

The media_device is part of a static global vimc_device struct.
The media framework expects this to be zeroed before it is
used, however, since this is a global this is not the case if
vimc is unbound and then bound again.

So call memset to ensure any left-over values are cleared.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/vimc/vimc-core.c