staging/mmal-vchiq: Fix incorrect static vchiq_instance.
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Tue, 5 Jan 2021 14:34:20 +0000 (14:34 +0000)
committerpopcornmix <popcornmix@gmail.com>
Wed, 27 Jan 2021 19:13:30 +0000 (19:13 +0000)
commit572f1a32b5ef6bba956b4c9578737c4bdcecc72b
tree2d0529d47f821876f5280d41126abddbbdced342
parent5cf562635e9791c7c1e2489d11fdc78d15cc913b
staging/mmal-vchiq: Fix incorrect static vchiq_instance.

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.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c