Skip to contentSkip to conversation

staging: media: av7110: replace BUG() with error return in gpioirq

PATCH New Artem Lytkin 1 participant 1 message Feb 7

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: media: av7110: replace BUG() with error return in gpioirq

Replace BUG() with a return statement in the gpioirq tasklet handler. If saa7146_wait_for_debi_done() times out, crashing the kernel is disproportionate. The pr_err() already logs the failure, and returning early avoids accessing hardware in a potentially broken state.

---
 drivers/staging/media/av7110/av7110.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/av7110/av7110.c +1 -1
index 602342d11..bd53d1a41 100644
@@ -460,7 +460,7 @@ static void gpioirq(struct tasklet_struct *t)
 
 	if (saa7146_wait_for_debi_done(av7110->dev, 0)) {
 		pr_err("%s(): saa7146_wait_for_debi_done timed out\n", __func__);
-		BUG(); /* maybe we should try resetting the debi? */
+		return;
 	}
 
 	spin_lock(&av7110->debilock);
Signature · 1 line
2.43.0