Skip to contentSkip to conversation

USB: Error handling bug fix for serial_open()

PATCH In review Richard Pearman 2 participants 2 messages Oct 22, 2007 – Oct 24, 2007 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#2 lore raw

PATCH 1/1 USB: Error handling bug fix for serial_open()

In reply to a message not in the archive

From: Richard Pearman <[email protected]>
From: Greg Breen <[email protected]>

When an error occurs in serial_open() ensure that port->tty and tty->driver_data are set to NULL, if previously assigned a value in the function.

---

drivers/usb/serial/usb-serial.c Mon Oct 22 11:12:23 2007 renamed from drivers/usb/serial/usb-serial.c.orig Mon Oct 22 11:12:29 2007 +0 -0
@@ -230,6 +230,8 @@ bailout_module_put:
    module_put(serial->type->driver.owner);

bailout_mutex_unlock:

    port->open_count = 0;
+    port->tty = NULL;
+    tty->driver_data = NULL;   
    mutex_unlock(&port->mutex);
bailout_kref_put:
    kref_put(&serial->kref, destroy_serial);

begin:vcard
fn:Richard Pearman
n:Pearman;Richard
org:Intellect Australia;Embedded Systems Team
adr:EIR Building, Technology Park, Bentley;;Suite 11 and 12, 1 Sarich Way;Perth;WA;6102;Australia email;internet:[email protected]
title:Senior embedded systems engineer
tel;work:+61 (08) 9472 2271
tel;fax:+61 (08) 9470 2584
x-mozilla-html:FALSE
url:http://www.intellect.be
version:2.1
end:vcard

#3 lore raw
Quoted 10 lines · Richard Pearman

From: Richard Pearman <[email protected]>
From: Greg Breen <[email protected]>

When an error occurs in serial_open() ensure that port->tty and tty->driver_data are set to NULL, if previously assigned a value in the function.

---
--- linux-2.6.17.1/drivers/usb/serial/usb-serial.c.orig Mon Oct 22

This has already been fixed in newer kernel versions.

Thanks for the patch though.

greg k-h