Re: [patch 1/3] tty: resolve tty contention between kernel and user space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 09, 2017 at 06:04:17PM +0300, Andy Shevchenko wrote:
> On Sun, Jul 9, 2017 at 2:41 PM, Okash Khawaja <okash.khawaja@xxxxxxxxx> wrote:
> 
> > +struct tty_struct *tty_kopen(dev_t device)
> > +{
> > +       struct tty_struct *tty;
> > +       struct tty_driver *driver = NULL;
> > +       int index = -1;
> > +
> > +       mutex_lock(&tty_mutex);
> > +       driver = tty_lookup_driver(device, NULL, &index);
> > +       if (IS_ERR(driver)) {
> 
> > +               mutex_unlock(&tty_mutex);
> > +               return ERR_CAST(driver);
> 
> Hmm... perhaps
> 
> tty = ERR_CAST(driver);
> goto out_unlock;
> 
> See below for further details.
> 
Sorry missed this one out. Since tty_lookup_driver has failed, we don't
need to down the refcount on driver. So we can return here, without
going to out_unlock.

Thanks,
Okash
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux