From: Laura Garcia Liebana Date: Wed, 24 Feb 2016 17:11:07 +0000 (+0100) Subject: staging: nvec: Avoid the use of BUG_ON X-Git-Tag: v4.6-rc1~103^2~119 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=350698f6efe844f9f40bf47da7bbab75eba34c61;p=karo-tx-linux.git staging: nvec: Avoid the use of BUG_ON Prevent a kernel panic by avoiding the use of the BUG_ON macro. Checkpatch detected this issue. The BUG_ON macro is not needed as such cases shouldn't happen and they were introduced for debugging purposes. Signed-off-by: Laura Garcia Liebana Acked-by: Marc Dietrich Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index c335ae2f1713..f6a1dbb4b66b 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;