Re: [PATCH] hso: fix refcnt leak in recent patch.

2015-04-16 Thread Olivier Sobrie
t;parent->ref); > > } > > > > usb_autopm_put_interface(serial->parent->interface); > > > Sorry - that was wrong. > I'm getting crashes which strongly suggest the kref_put is being called extra > times, but I misunderstood the code and was hast

Re: [PATCH] hso: fix refcnt leak in recent patch.

2015-04-14 Thread NeilBrown
e and was hasty. > > > > Maybe this instead? > > Indeed, if I undestand correctly the code in tty_io.c, cleanup() method > is also called when the open fails while kref_get is only done if the > open succeeds. Sorry for that mess. > I assume you get that crash when hso_start_se

Re: [PATCH] hso: fix refcnt leak in recent patch.

2015-04-13 Thread Olivier Sobrie
d was hasty. > > Maybe this instead? Indeed, if I undestand correctly the code in tty_io.c, cleanup() method is also called when the open fails while kref_get is only done if the open succeeds. Sorry for that mess. I assume you get that crash when hso_start_s

Re: [PATCH] hso: fix refcnt leak in recent patch.

2015-04-13 Thread NeilBrown
s already open"); > + kref_get(&serial->parent->ref); > } > > usb_autopm_put_interface(serial->parent->interface); Sorry - that was wrong. I'm getting crashes which strongly suggest the kref_put is being called extra times, but I m

[PATCH] hso: fix refcnt leak in recent patch.

2015-04-13 Thread NeilBrown
Prior to commit 29bd3bc1194c624ce863cab2a7da9bc1f0c3b47b hso: fix crash when device disappears while serial port is open hso_serial_open would always kref_get(&serial->parent->ref) before returning zero. Since that commit, it only calls kref_get when returning 0 if serial->port.count was zer