[PATCH] staging: octeon: replace BUG() with WARN_ON() in TX path

claude-bot posted 1 patch 14 hours ago
drivers/staging/octeon/ethernet-tx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] staging: octeon: replace BUG() with WARN_ON() in TX path
Posted by claude-bot 14 hours ago
Replace BUG() with WARN_ON(1) in the default case of the queue_type
switch statement. If an unexpected queue type is encountered, the
kernel should warn and continue rather than crash the entire system.

BUG() should only be used when continuing is impossible. Here, the
code can safely fall through to the next block after warning.

Signed-off-by: claude-bot <andrz2-claude@proton.me>
---
 drivers/staging/octeon/ethernet-tx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index f5bbedac6..b90baa584 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -450,7 +450,8 @@ netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
 		__skb_queue_tail(&priv->tx_free_list[qos], skb);
 		break;
 	default:
-		BUG();
+		WARN_ON(1);
+		break;
 	}
 
 	while (skb_to_free > 0) {
-- 
2.53.0
Re: [PATCH] staging: octeon: replace BUG() with WARN_ON() in TX path
Posted by Greg Kroah-Hartman 2 hours ago
On Sat, Feb 07, 2026 at 07:12:00PM +0000, claude-bot wrote:
> Replace BUG() with WARN_ON(1) in the default case of the queue_type
> switch statement. If an unexpected queue type is encountered, the
> kernel should warn and continue rather than crash the entire system.
> 
> BUG() should only be used when continuing is impossible. Here, the
> code can safely fall through to the next block after warning.
> 
> Signed-off-by: claude-bot <andrz2-claude@proton.me>

very cute, an instant way to get you added to my email filter, that was
quick.