Re: [PATCH 1/3] staging: dgnc: return error code directly

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

 



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
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