lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1373533573-12272-39-git-send-email-ming.lei@canonical.com>
Date:	Thu, 11 Jul 2013 17:06:01 +0800
From:	Ming Lei <ming.lei@...onical.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	linux-usb@...r.kernel.org, Oliver Neukum <oliver@...kum.org>,
	Alan Stern <stern@...land.harvard.edu>,
	linux-input@...r.kernel.org, linux-bluetooth@...r.kernel.org,
	netdev@...r.kernel.org, linux-wireless@...r.kernel.org,
	linux-media@...r.kernel.org, alsa-devel@...a-project.org,
	Ming Lei <ming.lei@...onical.com>,
	Mauro Carvalho Chehab <mchehab@...hat.com>
Subject: [PATCH 38/50] media: usb: tlg2300: spin_lock in complete() cleanup

Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().

Cc: Mauro Carvalho Chehab <mchehab@...hat.com>
Cc: linux-media@...r.kernel.org
Signed-off-by: Ming Lei <ming.lei@...onical.com>
---
 drivers/media/usb/tlg2300/pd-video.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/tlg2300/pd-video.c b/drivers/media/usb/tlg2300/pd-video.c
index 8df668d..4e5bd07 100644
--- a/drivers/media/usb/tlg2300/pd-video.c
+++ b/drivers/media/usb/tlg2300/pd-video.c
@@ -151,11 +151,12 @@ static void init_copy(struct video_data *video, bool index)
 static bool get_frame(struct front_face *front, int *need_init)
 {
 	struct videobuf_buffer *vb = front->curr_frame;
+	unsigned long flags;
 
 	if (vb)
 		return true;
 
-	spin_lock(&front->queue_lock);
+	spin_lock_irqsave(&front->queue_lock, flags);
 	if (!list_empty(&front->active)) {
 		vb = list_entry(front->active.next,
 			       struct videobuf_buffer, queue);
@@ -164,7 +165,7 @@ static bool get_frame(struct front_face *front, int *need_init)
 		front->curr_frame = vb;
 		list_del_init(&vb->queue);
 	}
-	spin_unlock(&front->queue_lock);
+	spin_unlock_irqrestore(&front->queue_lock, flags);
 
 	return !!vb;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ