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

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

 



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.

> @@ -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).

regards,
dan carpenter

_______________________________________________
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