Re: [PATCH v2] staging: nvec: Avoid the use of BUG_ON

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

 



Am Dienstag, 23. Februar 2016, 21:59:04 CET schrieb Laura Garcia Liebana:
> Prevent a kernel panic by avoiding the use of the BUG_ON macro.
> Checkpatch detected this issue.
> 
> Signed-off-by: Laura Garcia Liebana <nevola@xxxxxxxxx>

Acked-by: Marc Dietrich <marvin24@xxxxxx>

> ---
> Changes in v2:
> 	- According to Marc Dietrich, module creator, the WARN_ON macro is not
> needed as such cases shouldn't happen and they were introduced for
> debugging purposes.
> 
>  drivers/staging/nvec/nvec.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
> index c335ae2..f6a1dbb 100644
> --- a/drivers/staging/nvec/nvec.c
> +++ b/drivers/staging/nvec/nvec.c
> @@ -641,11 +641,9 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
>  			nvec_msg_free(nvec, nvec->rx);
>  			nvec->state = 3;
>  			nvec_tx_set(nvec);
> -			BUG_ON(nvec->tx->size < 1);
>  			to_send = nvec->tx->data[0];
>  			nvec->tx->pos = 1;
>  		} else if (status == (I2C_SL_IRQ)) {
> -			BUG_ON(nvec->rx == NULL);
>  			nvec->rx->data[1] = received;
>  			nvec->rx->pos = 2;
>  			nvec->state = 4;

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
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