Commit 3dbe93bf authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: make sure we never reference a usbserial port after it has been unregistered.

parent 63fc7434
...@@ -871,8 +871,10 @@ static void destroy_serial (struct kobject *kobj) ...@@ -871,8 +871,10 @@ static void destroy_serial (struct kobject *kobj)
/* the ports are cleaned up and released in port_release() */ /* the ports are cleaned up and released in port_release() */
for (i = 0; i < serial->num_ports; ++i) for (i = 0; i < serial->num_ports; ++i)
if (serial->port[i]->dev.parent != NULL) if (serial->port[i]->dev.parent != NULL) {
device_unregister(&serial->port[i]->dev); device_unregister(&serial->port[i]->dev);
serial->port[i] = NULL;
}
/* If this is a "fake" port, we have to clean it up here, as it will /* If this is a "fake" port, we have to clean it up here, as it will
* not get cleaned up in port_release() as it was never registered with * not get cleaned up in port_release() as it was never registered with
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment