usb-serial: ftdi_sio: fix oops during autosuspend
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 7 May 2012 15:20:06 +0000 (11:20 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Jun 2012 07:18:20 +0000 (15:18 +0800)
commit2aa5c3521c154db6e3bbbda1a2f0b07da4938626
tree4dec143b6b632fbc38aef5bcfec3bc5a2d71f70f
parent27234cee48f54e3f3125e44bc8b05c42b977a113
usb-serial: ftdi_sio: fix oops during autosuspend

commit 5cbe61c5aff0a8ada691eb8b07dbfb55c303f640 upstream.

This patch (as1550) fixes a bug in the usb-serial core that affects
the ftdi_sio driver and most likely others as well.  The core
implements suspend and resume routines, but it doesn't store pointers
to those routines in the usb_driver structures that it registers,
even though it does set those drivers' supports_autosuspend flag.  The
end result is that when one of these devices is autosuspended, we try
to call through a NULL pointer.

The patch fixes the problem by setting the suspend and resume method
pointers to the appropriate routines in the USB serial core, along
with the supports_autosuspend field, in each driver as it is
registered.

This should be back-ported to all the stable kernels that have the new
usb_serial_register_drivers() interface.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Frank Schäfer <schaefer.frank@gmx.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/usb-serial.c