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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 15 Apr 2008 15:55:06 +0200
From:	Oliver Neukum <oliver@...kum.org>
To:	Greg KH <greg@...ah.com>
Cc:	linux-usb@...r.kernel.org, netdev@...r.kernel.org,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Filip Aben <f.aben@...ion.com>,
	Paulius Zaleckas <paulius.zaleckas@...tonika.lt>,
	ajb@...eresystems.co.uk
Subject: Re: [RFC] Patch to option HSO driver to the kernel

Am Montag, 14. April 2008 23:32:39 schrieb Greg KH:
> Hi all,
> 
> Here's a patch that I have cleaned up for context only from Option that
> is a USB serial / network device all in one.
> 
> I'd like to see this go into 2.6.26, so any review comments by anyone
> who wishes to review any portion of this would be greatly apprecited.

This patch removes a creative abuse of in_interrupt(). Locking
is always done with a mutex now. No need for atomic operations.

Signed-off-by: Oliver Neukum <oneukum@...e.de>

---

--- linux-2.6.25-rc7-work/drivers/net/usb/hso.c.alt2	2008-04-15 15:21:25.000000000 +0200
+++ linux-2.6.25-rc7-work/drivers/net/usb/hso.c	2008-04-15 15:29:17.000000000 +0200
@@ -2201,21 +2201,13 @@ static int hso_stop_serial_device(struct
 		return -ENODEV;
 
 	for (i = 0; i < serial->num_rx_urbs; i++) {
-		if (serial->rx_urb[i]
-		    && (serial->rx_urb[i]->status == -EINPROGRESS)) {
-			if (in_interrupt())
-				usb_unlink_urb(serial->rx_urb[i]);
-			else
+		if (serial->rx_urb[i])
 				usb_kill_urb(serial->rx_urb[i]);
-		}
 	}
 
-	if (serial->tx_urb && (serial->tx_urb->status == -EINPROGRESS)) {
-		if (in_interrupt())
-			usb_unlink_urb(serial->tx_urb);
-		else
-			usb_kill_urb(serial->rx_urb[i]);
-	}
+	if (serial->tx_urb)
+		usb_kill_urb(serial->rx_urb[i]);
+
 	if (serial->shared_int) {
 		spin_lock_bh(&serial->shared_int->shared_int_lock);
 		if (serial->shared_int->use_count &&
@@ -2223,12 +2215,8 @@ static int hso_stop_serial_device(struct
 			struct urb *urb;
 
 			urb = serial->shared_int->shared_intr_urb;
-			if ((urb) && (urb->status == -EINPROGRESS)) {
-				if (in_interrupt())
-					usb_unlink_urb(urb);
-				else
-					usb_kill_urb(urb);
-			}
+			if (urb)
+				usb_kill_urb(urb);
 		}
 		spin_unlock_bh(&serial->shared_int->shared_int_lock);
 	}

--
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