media: allegro: fix race conditions in channel handling
Since the channel list is used in different contexts, it must be ensured
that it is always consistent. Also, the channels contained in the list may
only be released when they are no longer needed in any context.
Add a lock to protect the list and reference handling for the channels.
Signed-off-by: Matthias Fend <matthias.fend@emfend.at> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>