Re: Question on release_one_tty

2014-08-07 Thread Cyrill Gorcunov
On Thu, Aug 07, 2014 at 01:05:28PM +0400, Pavel Emelyanov wrote: > > > > So how this code supposed to work then? I mean tty_driver_kref_put must > > never call > > for destruct_tty_driver, otherwise we're accessing freed memory. > > mod = driver->owner; > tty_driver_kref_put(driver); > module_pu

Re: Question on release_one_tty

2014-08-07 Thread Pavel Emelyanov
On 08/07/2014 12:34 PM, Cyrill Gorcunov wrote: > On Thu, Aug 07, 2014 at 12:28:58PM +0400, Pavel Emelyanov wrote: >> On 08/07/2014 12:25 PM, Cyrill Gorcunov wrote: >>> Hi guys, could you please explain me the sequence >>> >>> static void release_one_tty(struct work_struct *work) >>> { >>> struc

Re: Question on release_one_tty

2014-08-07 Thread Cyrill Gorcunov
On Thu, Aug 07, 2014 at 12:28:58PM +0400, Pavel Emelyanov wrote: > On 08/07/2014 12:25 PM, Cyrill Gorcunov wrote: > > Hi guys, could you please explain me the sequence > > > > static void release_one_tty(struct work_struct *work) > > { > > struct tty_struct *tty = > > container_of(

Re: Question on release_one_tty

2014-08-07 Thread Pavel Emelyanov
On 08/07/2014 12:25 PM, Cyrill Gorcunov wrote: > Hi guys, could you please explain me the sequence > > static void release_one_tty(struct work_struct *work) > { > struct tty_struct *tty = > container_of(work, struct tty_struct, hangup_work); > struct tty_driver *driver =

Question on release_one_tty

2014-08-07 Thread Cyrill Gorcunov
Hi guys, could you please explain me the sequence static void release_one_tty(struct work_struct *work) { struct tty_struct *tty = container_of(work, struct tty_struct, hangup_work); struct tty_driver *driver = tty->driver; if (tty->ops->cleanup)