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