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-24-git-send-email-ming.lei@canonical.com>
Date:	Thu, 11 Jul 2013 17:05:46 +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>,
	Marcel Holtmann <marcel@...tmann.org>,
	Gustavo Padovan <gustavo@...ovan.org>,
	Johan Hedberg <johan.hedberg@...il.com>
Subject: [PATCH 23/50] BT: bfusb: read_lock in complete() cleanup

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

Cc: Marcel Holtmann <marcel@...tmann.org>
Cc: Gustavo Padovan <gustavo@...ovan.org>
Cc: Johan Hedberg <johan.hedberg@...il.com>
Cc: linux-bluetooth@...r.kernel.org
Signed-off-by: Ming Lei <ming.lei@...onical.com>
---
 drivers/bluetooth/bfusb.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index 995aee9..2e93501 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -186,6 +186,7 @@ static void bfusb_tx_complete(struct urb *urb)
 {
 	struct sk_buff *skb = (struct sk_buff *) urb->context;
 	struct bfusb_data *data = (struct bfusb_data *) skb->dev;
+	unsigned long flags;
 
 	BT_DBG("bfusb %p urb %p skb %p len %d", data, urb, skb, skb->len);
 
@@ -199,14 +200,14 @@ static void bfusb_tx_complete(struct urb *urb)
 	else
 		data->hdev->stat.err_tx++;
 
-	read_lock(&data->lock);
+	read_lock_irqsave(&data->lock, flags);
 
 	skb_unlink(skb, &data->pending_q);
 	skb_queue_tail(&data->completed_q, skb);
 
 	bfusb_tx_wakeup(data);
 
-	read_unlock(&data->lock);
+	read_unlock_irqrestore(&data->lock, flags);
 }
 
 
@@ -347,10 +348,11 @@ static void bfusb_rx_complete(struct urb *urb)
 	unsigned char *buf = urb->transfer_buffer;
 	int count = urb->actual_length;
 	int err, hdr, len;
+	unsigned long flags;
 
 	BT_DBG("bfusb %p urb %p skb %p len %d", data, urb, skb, skb->len);
 
-	read_lock(&data->lock);
+	read_lock_irqsave(&data->lock, flags);
 
 	if (!test_bit(HCI_RUNNING, &data->hdev->flags))
 		goto unlock;
@@ -392,7 +394,7 @@ static void bfusb_rx_complete(struct urb *urb)
 
 	bfusb_rx_submit(data, urb);
 
-	read_unlock(&data->lock);
+	read_unlock_irqrestore(&data->lock, flags);
 
 	return;
 
@@ -406,7 +408,7 @@ resubmit:
 	}
 
 unlock:
-	read_unlock(&data->lock);
+	read_unlock_irqrestore(&data->lock, flags);
 }
 
 static int bfusb_open(struct hci_dev *hdev)
-- 
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