clear-pkgs-linux-iot-lts2018/1105-media-ici-Fix-system-r...

47 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Poluri, Sarat Chandra" <sarat.chandra.poluri@intel.com>
Date: Tue, 9 Apr 2019 22:28:30 +0000
Subject: [PATCH] media: ici: Fix system reboot upon stream stop after a fatal
error in multi-streaming use case.
ici_isys_frame_buf_stream_cancel should be called outside of the mutex and
after ip->streaming set to 0. This avoids NULL pointer dereference in
unmap_buf_virt.
Change-Id: Ib9eab6b92ca0680fd220965b7b7a4d3dfa894b3e
Tracked-On: PKT-2287
Tracked-On: HSDES-1409169225
Signed-off-by: Poluri, Sarat Chandra <sarat.chandra.poluri@intel.com>
---
drivers/media/pci/intel/ici/ici-isys-stream.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/media/pci/intel/ici/ici-isys-stream.c b/drivers/media/pci/intel/ici/ici-isys-stream.c
index ebcc729..09fcd02 100644
--- a/drivers/media/pci/intel/ici/ici-isys-stream.c
+++ b/drivers/media/pci/intel/ici/ici-isys-stream.c
@@ -960,18 +960,11 @@ static int ici_isys_stream_off(struct file *file, void *fh)
if (ip->streaming)
ici_isys_set_streaming(as, 0);
- ici_isys_frame_buf_short_packet_destroy(as);
- mutex_unlock(&as->isys->stream_mutex);
-
- ici_isys_frame_buf_stream_cancel(as);
-
- mutex_lock(&as->isys->stream_mutex);
- //streaming always should be turned off last.
- //This variable prevents other streams from
- //starting before we are done with cleanup.
ip->streaming = 0;
mutex_unlock(&as->isys->stream_mutex);
+ ici_isys_frame_buf_short_packet_destroy(as);
+ ici_isys_frame_buf_stream_cancel(as);
pipeline_set_power(as, 0);
return 0;
}
--
https://clearlinux.org