Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c115245 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: avoid race condition during session stream destroy"

parents 475a42c2 bc6da1e7
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -250,8 +250,9 @@ void msm_delete_stream(unsigned int session_id, unsigned int stream_id)
	spin_lock_irqsave(&(session->stream_q.lock), flags);
	list_del_init(&stream->list);
	session->stream_q.len--;
	kfree(stream);
	stream = NULL;
	spin_unlock_irqrestore(&(session->stream_q.lock), flags);
	kzfree(stream);
}

static void msm_sd_unregister_subdev(struct video_device *vdev)
@@ -475,8 +476,12 @@ static inline int __msm_sd_notify_freeze_subdevs(struct msm_sd_subdev *msm_sd)
static inline int __msm_destroy_session_streams(void *d1, void *d2)
{
	struct msm_stream *stream = d1;
	unsigned long flags;

	pr_err("%s: Error: Destroyed list is not empty\n", __func__);
	spin_lock_irqsave(&stream->stream_lock, flags);
	INIT_LIST_HEAD(&stream->queued_list);
	spin_unlock_irqrestore(&stream->stream_lock, flags);
	return 0;
}