mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 01:43:18 +00:00
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 <[email protected]>
Acked-by: Sakari Ailus <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Fixes: cf4b9211b5 ("[media] media: Media device node support")
Cc: [email protected]
Signed-off-by: Sakari Ailus <[email protected]>