]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
staging: mmal-vchiq: Fix incorrect static vchiq_instance.
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Tue, 25 May 2021 21:57:37 +0000 (23:57 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:31:17 +0000 (09:31 +0200)
commit06bcf21e8d360d45455aea5e848ac693f10bc883
treefe2eb191276f0e407fc3fdfa76668a766a88827c
parent6d0d634024e8039c2ba7c31462673e9e79f3a04b
staging: mmal-vchiq: Fix incorrect static vchiq_instance.

BugLink: https://bugs.launchpad.net/bugs/1938340
[ Upstream commit afc023da53e46b88552822f2fe035c7129c505a2 ]

For some reason lost in history function vchiq_mmal_init used
a static variable for storing the vchiq_instance.
This value is retrieved from vchiq per instance, so worked fine
until you try to call vchiq_mmal_init multiple times concurrently
when things then go wrong. This seemed to happen quite frequently
if using the cutdown firmware (no MMAL or VCSM services running)
as the vchiq_connect then failed, and one or other vchiq_shutdown
was working on an invalid handle.

Remove the static so that each caller gets a unique vchiq_instance.

Fixes: 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621979857-26754-1-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c