From 572f1a32b5ef6bba956b4c9578737c4bdcecc72b Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 5 Jan 2021 14:34:20 +0000 Subject: [PATCH] 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 --- drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c index 0f98494..014fbac 100644 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c @@ -2086,7 +2086,7 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance) int status; int err = -ENODEV; struct vchiq_mmal_instance *instance; - static struct vchiq_instance *vchiq_instance; + struct vchiq_instance *vchiq_instance; struct vchiq_service_params_kernel params = { .version = VC_MMAL_VER, .version_min = VC_MMAL_MIN_VER, -- 2.7.4