Greg --

This patch does not correctly handle failures from try_module_get
or usb_serial_get_by_index.  Please ignore this patch--I will send
a better one later.

Thanks,
-- Al

--- linux-2.6.10-rc1-bk14.orig/drivers/usb/serial/usb-serial.c 2004-11-05 01:35:08.000000000 -0600
+++ linux-2.6.10-rc1-bk14.new/drivers/usb/serial/usb-serial.c 2004-11-05 20:17:41.000000000 -0600
@@ -482,14 +482,11 @@

dbg("%s", __FUNCTION__);
- /* initialize the pointer incase something fails */
- tty->driver_data = NULL;
-
/* get the serial object associated with this tty pointer */
serial = usb_serial_get_by_index(tty->index);
if (!serial) {
- retval = -ENODEV;
- goto bailout;
+ tty->driver_data = NULL;
+ return -ENODEV;
}
/* set up our port structure making the tty driver remember our port object, and us it */
@@ -502,8 +499,8 @@
/* lock this module before we call it,
this may, which means we must bail out, safe because we are called with BKL held */
if (!try_module_get(serial->type->owner)) {
- retval = -ENODEV;
- goto bailout;
+ kref_put(&serial->kref, destroy_serial);
+ return -ENODEV;
}
++port->open_count;
@@ -517,7 +514,6 @@
kref_put(&serial->kref, destroy_serial);
}
}
-bailout:
return retval;
}
@@ -530,6 +526,9 @@
dbg("%s - port %d", __FUNCTION__, port->number);
+ if (port->open_count <= 0)
+ return;
+
--port->open_count;
if (port->open_count <= 0) {
/* only call the device specific close if this





------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel





-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to