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]
Date:	Tue, 26 Jul 2016 20:00:00 +0200
From:	Mathieu OTHACEHE <m.othacehe@...il.com>
To:	johan@...nel.org, gregkh@...uxfoundation.org
Cc:	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
	Mathieu OTHACEHE <m.othacehe@...il.com>
Subject: [PATCH v2 20/22] usb: serial: ti_usb_3410_5052: Set shadow msr before waking up waiters

Save msr before testing the delta and waking up any waiters.
Also use port directly instead of tport->tp_port.

Signed-off-by: Mathieu OTHACEHE <m.othacehe@...il.com>
---
 drivers/usb/serial/ti_usb_3410_5052.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 24e1d52..168a969 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -1547,9 +1547,12 @@ static void ti_handle_new_msr(struct usb_serial_port *port, u8 msr)
 
 	dev_dbg(&port->dev, "%s - msr 0x%02X\n", __func__, msr);
 
+	spin_lock_irqsave(&tport->tp_lock, flags);
+	tport->tp_msr = msr & TI_MSR_MASK;
+	spin_unlock_irqrestore(&tport->tp_lock, flags);
+
 	if (msr & TI_MSR_DELTA_MASK) {
-		spin_lock_irqsave(&tport->tp_lock, flags);
-		icount = &tport->tp_port->icount;
+		icount = &port->icount;
 		if (msr & TI_MSR_DELTA_CTS)
 			icount->cts++;
 		if (msr & TI_MSR_DELTA_DSR)
@@ -1558,11 +1561,9 @@ static void ti_handle_new_msr(struct usb_serial_port *port, u8 msr)
 			icount->dcd++;
 		if (msr & TI_MSR_DELTA_RI)
 			icount->rng++;
+
 		wake_up_interruptible(&port->port.delta_msr_wait);
-		spin_unlock_irqrestore(&tport->tp_lock, flags);
 	}
-
-	tport->tp_msr = msr & TI_MSR_MASK;
 }
 
 
-- 
2.9.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ