[PATCH v2] USB: serial: mos7720: fix mos_parport refcount imbalance on error path

2019-03-20 Thread Lin Yi
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 --- drivers/usb/serial/mos7720.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH] usb-serial: fix mos_parport refcount imbalance on error path

2019-03-19 Thread Lin Yi
write_parport_ref_nonblock increase mos_parport refcount without decrease it when return -ENOMEM code, so need a decrement before function return -ENOMEM. Signed-off-by: Lin Yi --- drivers/usb/serial/mos7720.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/serial/mos7720.c b