summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>2020-09-22 14:33:59 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-09-27 12:35:04 +0300
commitacb00111e906be800cf4b26625e1e0e42d123289 (patch)
treefdd74bf581e0fdf756de22b2edde2416a721a50f /drivers
parent9de6144926fea3526fac2a08f63af9a4bc678e36 (diff)
downloadlinux-acb00111e906be800cf4b26625e1e0e42d123289.tar.xz
media: staging: rkisp1: stats: protect write to 'is_streaming' in start_streaming cb
The field stats->is_streaming is written in 'start_streaming' callback without the stats->lock protection. The isr might run together with the callback so 'spin_lock_irq' should be used. Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Acked-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/media/rkisp1/rkisp1-stats.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/media/rkisp1/rkisp1-stats.c b/drivers/staging/media/rkisp1/rkisp1-stats.c
index 6aa18d970f2b..51c64f75fe29 100644
--- a/drivers/staging/media/rkisp1/rkisp1-stats.c
+++ b/drivers/staging/media/rkisp1/rkisp1-stats.c
@@ -157,7 +157,9 @@ rkisp1_stats_vb2_start_streaming(struct vb2_queue *queue, unsigned int count)
{
struct rkisp1_stats *stats = queue->drv_priv;
+ spin_lock_irq(&stats->lock);
stats->is_streaming = true;
+ spin_unlock_irq(&stats->lock);
return 0;
}