Skip to contentSkip to conversation

staging: nvec: Avoid the use of BUG_ON

PATCH Superseded Laura Garcia Liebana 1 participant 1 message Feb 23, 2016

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
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(-)
drivers/staging/nvec/nvec.c +0 -2
index c335ae2..f6a1dbb 100644
@@ -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;
Signature · 1 line
2.7.0