net: ethernet: mediatek: avoid potential invalid memory access
authorSean Wang <sean.wang@mediatek.com>
Sat, 22 Jul 2017 12:45:55 +0000 (20:45 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Jul 2017 20:43:23 +0000 (13:43 -0700)
commit6c7fce6fa86a110d6455662d823c4e09f8f7be4a
tree038a3d9491954e109acb58200ef3129b96e38dbd
parent96080f697786e0a30006fcbcc5b53f350fcb3e9f
net: ethernet: mediatek: avoid potential invalid memory access

Potential dangerous invalid memory might be accessed if invalid mac value
reflected from the forward port field in rxd4 caused by possible potential
hardware defects. So added a simple sanity checker to avoid the kind of
situation happening.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Acked-by: John Crispin <john@phrozen.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_eth_soc.c