WSL2-Linux-Kernel/drivers/media/mc
Hans Verkuil 8149eaddde media: mc: mark the media devnode as registered from the, start
commit 4bc60736154bc9e0e39d3b88918f5d3762ebe5e0 upstream.

First the media device node was created, and if successful it was
marked as 'registered'. This leaves a small race condition where
an application can open the device node and get an error back
because the 'registered' flag was not yet set.

Change the order: first set the 'registered' flag, then actually
register the media device node. If that fails, then clear the flag.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Fixes: cf4b9211b5 ("[media] media: Media device node support")
Cc: stable@vger.kernel.org
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-16 13:39:56 +02:00
..
Kconfig
Makefile media: Fix Media Controller API config checks 2021-06-24 14:26:00 +02:00
mc-dev-allocator.c
mc-device.c media: mc-device.c: use DEVICE_ATTR_RO() helper macro 2021-08-04 14:43:50 +02:00
mc-devnode.c media: mc: mark the media devnode as registered from the, start 2024-06-16 13:39:56 +02:00
mc-entity.c
mc-request.c