From: Niklas Söderlund Date: Fri, 15 Jan 2021 00:21:45 +0000 (+0100) Subject: media: rcar-vin: Do not try to stop stream if not running X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c4f115355c53a0df9ac3a8a33f31ff23970c2737;p=linux.git media: rcar-vin: Do not try to stop stream if not running Do not attempt to stop the streaming if the stream is not running. Signed-off-by: Niklas Söderlund Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c index 48280ddb15b9b..f30dafbdf61ca 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c @@ -1301,6 +1301,11 @@ void rvin_stop_streaming(struct rvin_dev *vin) spin_lock_irqsave(&vin->qlock, flags); + if (vin->state == STOPPED) { + spin_unlock_irqrestore(&vin->qlock, flags); + return; + } + vin->state = STOPPING; /* Wait until only scratch buffer is used, max 3 interrupts. */