Lin Yi 2908b076f5 USB: serial: mos7720: fix mos_parport refcount imbalance on error path
The write_parport_reg_nonblock() helper takes a reference to the struct
mos_parport, but failed to release it in a couple of error paths after
allocation failures, leading to a memory leak.

Johan said that move the kref_get() and mos_parport assignment to the
end of urbtrack initialisation is a better way, so move it. and
mos_parport do not used until urbtrack initialisation.

Signed-off-by: Lin Yi <teroincn@163.com>
Fixes: b69578df7e98 ("USB: usbserial: mos7720: add support for parallel port on moschip 7715")
Cc: stable <stable@vger.kernel.org>     # 2.6.35
Signed-off-by: Johan Hovold <johan@kernel.org>
2019-03-20 13:58:42 +01:00
..
2019-03-06 16:48:27 -08:00
2019-03-09 16:53:47 -08:00
2019-03-10 11:54:48 -07:00
2019-02-15 09:08:57 +01:00
2019-02-15 09:08:57 +01:00
2019-03-09 16:53:47 -08:00