Commit 82272db84d874ebe8b4ae24d4e64d770882dbdd1

Authored by Florian Fainelli
Committed by David S. Miller
1 parent 3ebe8344eb

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>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

... ... @@ -121,7 +121,8 @@
121 121 /* We should never see a reserved reason code without knowing how to
122 122 * handle it
123 123 */
124   - WARN_ON(brcm_tag[2] & BRCM_EG_RC_RSVD);
  124 + if (unlikely(brcm_tag[2] & BRCM_EG_RC_RSVD))
  125 + goto out_drop;
125 126  
126 127 /* Locate which port this is coming from */
127 128 source_port = brcm_tag[3] & BRCM_EG_PID_MASK;