Re: [PATCH] USB: serial: Enforce USB driver and USB serial driver match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 29 May 2012, Bjørn Mork wrote:

> Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> writes:
> 
> > This is the
> >
> > 	serial->type->disconnect(serial);
> >
> > call near the end of usb_serial_disconnect().  Evidently the crash 
> > occurs because pl2303_device doesn't have a disconnect method.
> >
> > It would help if the serial.h file explained clearly which methods are 
> > optional and which are obligatory.  At any rate, the bug can be fixed 
> > by testing whether serial->type->disconnect is non-NULL before calling 
> > it.
> >
> > This does not appear to be related to Bjørn's problem.
> 
> I am not too sure about that.  What happens here is that you've got the
> usbserial_generic driver bound to the interface and serial->type
> pointing to pl2303.  But pl2303 has already been unloaded successfully,
> as it wasn't bound to any device as far as the system knew.  You
> therefore end up calling a serial->type->disconnect pointing into the
> unloaded pl2303 driver.

Maybe so.  But even if that hadn't happened, we would still end up
calling pl2303's disconnect method -- which doesn't exist.

> I'm building a 3.3.7 kernel to see if I can provoke the problem there
> too, but I don't think so.  I never saw it until recently, and I can now
> reproduce it consistently by merely doing plug-unplug-plug with any USB
> serial device.

Don't use 3.3.7.  The new registration code may well be in the stable 
kernels.  Use plain old 3.3 (or 3.3.0 if you prefer to call it that).

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux