USB: serial: mos7720: fix parport use-after-free on probe errors
authorJohan Hovold <johan@kernel.org>
Tue, 3 Jan 2017 15:39:52 +0000 (16:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2017 10:22:46 +0000 (11:22 +0100)
commit5c83e07c3c8b1c8763c4e575fc109e70b1ecc5f7
treed787b195d1f6ca22f6a9d167a2e09915b620eceb
parent2f525ed5efb80f5bc246b69753a1b421b3258f3f
USB: serial: mos7720: fix parport use-after-free on probe errors

commit 75dd211e773afcbc264677b0749d1cf7d937ab2d upstream.

Do not submit the interrupt URB until after the parport has been
successfully registered to avoid another use-after-free in the
completion handler when accessing the freed parport private data in case
of a racing completion.

Fixes: b69578df7e98 ("USB: usbserial: mos7720: add support for parallel port on moschip 7715")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/mos7720.c