Re: [PATCH] Remove BUG_ON from n_tty_read()

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

 



On Fri, Aug 10, 2012 at 12:51:30PM +0200, Stanislav Kozina wrote:
> Change the BUG_ON to WARN_ON and return in case of tty->read_buf==NULL

A few small nitpicks.

Subject should include "tty:" prefix.

> -	BUG_ON(!tty->read_buf);
> +	if (!tty->read_buf) {
> +		WARN_ON(!tty->read_buf);
> +		return -EAGAIN;
> +	}

This usually is done in two lines:

if (WARN_ON())
	return;

Additionally, second BUG_ON(!tty->read_buf) in n_tty_read() should be
probably replaced too.

Thanks
Stanislaw
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux