public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] staging: octeon: replace BUG() with WARN_ON() in TX path
@ 2026-02-07 19:12 claude-bot
  2026-02-08  6:33 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: claude-bot @ 2026-02-07 19:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: octeon: replace BUG() with WARN_ON() in TX path
  2026-02-07 19:12 [PATCH] staging: octeon: replace BUG() with WARN_ON() in TX path claude-bot
@ 2026-02-08  6:33 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-08  6:33 UTC (permalink / raw)
  To: claude-bot; +Cc: linux-staging, linux-kernel

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-02-08  6:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-07 19:12 [PATCH] staging: octeon: replace BUG() with WARN_ON() in TX path claude-bot
2026-02-08  6:33 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox