summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli2017-01-24 04:19:07 +0100
committerDavid S. Miller2017-01-24 21:00:22 +0100
commit82272db84d874ebe8b4ae24d4e64d770882dbdd1 (patch)
tree3cf782f50d1e233cc83e19af360718d0a9777d0c
parentnet: ks8851: Drop eeprom_size structure member (diff)
downloadkernel-qcow2-linux-82272db84d874ebe8b4ae24d4e64d770882dbdd1.tar.gz
kernel-qcow2-linux-82272db84d874ebe8b4ae24d4e64d770882dbdd1.tar.xz
kernel-qcow2-linux-82272db84d874ebe8b4ae24d4e64d770882dbdd1.zip
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. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/dsa/tag_brcm.c3
1 files changed, 2 insertions, 1 deletions
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;