Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1565457 > unrolled thread

[PATCH net-next] net: dsa: Drop WARN() in tag_brcm.c

Started byFlorian Fainelli <f.fainelli@gmail.com>
First post2017-01-24 04:20 +0100
Last post2017-01-24 21:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net-next] net: dsa: Drop WARN() in tag_brcm.c Florian Fainelli <f.fainelli@gmail.com> - 2017-01-24 04:20 +0100
    Re: [PATCH net-next] net: dsa: Drop WARN() in tag_brcm.c David Miller <davem@davemloft.net> - 2017-01-24 21:10 +0100

#1565457 — [PATCH net-next] net: dsa: Drop WARN() in tag_brcm.c

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2017-01-24 04:20 +0100
Subject[PATCH net-next] net: dsa: Drop WARN() in tag_brcm.c
Message-ID<t2ZOi-7hC-3@gated-at.bofh.it>
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.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 net/dsa/tag_brcm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c
index af82927674e0..cb5a2b7a0118 100644
--- a/net/dsa/tag_brcm.c
+++ b/net/dsa/tag_brcm.c
@@ -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;
-- 
2.9.3

[toc] | [next] | [standalone]


#1566102

FromDavid Miller <davem@davemloft.net>
Date2017-01-24 21:10 +0100
Message-ID<t3fzI-kX-13@gated-at.bofh.it>
In reply to#1565457
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Mon, 23 Jan 2017 19:19:07 -0800

> 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.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web