Skip to contentSkip to conversation

net: dsa: Drop WARN() in tag_brcm.c

PATCH Applied Florian Fainelli 2 participants 2 messages Jan 24, 2017

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

PATCH 1/1 net: dsa: Drop WARN() in tag_brcm.c

We may be able to see invalid Broadcom tags when the hardware and drivers are misconfigured, or just while exercising the error path. Instead of flooding the console with messages, flat out drop the packet.

---
 net/dsa/tag_brcm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/dsa/tag_brcm.c +2 -1
index af82927674e0..cb5a2b7a0118 100644
@@ -121,7 +121,8 @@ static int brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev,
 	/* We should never see a reserved reason code without knowing how to
 	 * handle it
 	 */
-	WARN_ON(brcm_tag[2] & BRCM_EG_RC_RSVD);
+	if (unlikely(brcm_tag[2] & BRCM_EG_RC_RSVD))
+		goto out_drop;
 
 	/* Locate which port this is coming from */
 	source_port = brcm_tag[3] & BRCM_EG_PID_MASK;
Signature · 1 line
2.9.3
maintainer Applied
#1 lore raw

From: Florian Fainelli <[email protected]>
Date: Mon, 23 Jan 2017 19:19:07 -0800

Quoted 5 lines

We may be able to see invalid Broadcom tags when the hardware and drivers are misconfigured, or just while exercising the error path. Instead of flooding the console with messages, flat out drop the packet.

Applied.