On Tue, Mar 14, 2017 at 03:00:48PM +0300, Dan Carpenter wrote:
> On Mon, Mar 13, 2017 at 12:37:32PM +1100, Tobin C. Harding wrote:
> >     if (!tty || tty->magic != TTY_MAGIC)
> > -           return rc;
> > +           return -EIO;
> >  
> 
> [ snip ]
> 
> >     if (!tty || tty->magic != TTY_MAGIC)
> > -           return rc;
> > +           return -EFAULT;
> 
> My recolection is that these checks are totally unecessary.  They're
> basically a really rubbish check for memory corruption.  But could
> you make them return consistent error codes?  -EIO is fine.

Got it, thanks. I have read the error codes a hundred times and don't
feel like I know which ones go with which errors. This direction is
mos appreciated.

> 
> > @@ -2427,7 +2423,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, 
> > unsigned int cmd,
> >             rc = tty_check_change(tty);
> >             spin_unlock_irqrestore(&ch->ch_lock, flags);
> >             if (rc)
> > -                   return rc;
> > +                   return -ENODEV;
> 
> Please preserve the error code from tty_check_change() here (and similar
> places).

My mistake. Will fix it.

thanks,
Tobin.
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to