net: tulip: de4x5: fix the problem that the array 'lp->phy[8]' may be out of bound
authorzhangyue <zhangyue1@kylinos.cn>
Thu, 18 Nov 2021 05:46:32 +0000 (13:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Dec 2021 08:04:40 +0000 (09:04 +0100)
commit12f907cb11576b8cd0b1d95a16d1f10ed5bb7237
tree2443a5d393828392c7c8b4732e69f166f430b8f7
parent634ef8cf4e51841a1f7d7bd5771335b4e1960690
net: tulip: de4x5: fix the problem that the array 'lp->phy[8]' may be out of bound

[ Upstream commit 61217be886b5f7402843677e4be7e7e83de9cb41 ]

In line 5001, if all id in the array 'lp->phy[8]' is not 0, when the
'for' end, the 'k' is 8.

At this time, the array 'lp->phy[8]' may be out of bound.

Signed-off-by: zhangyue <zhangyue1@kylinos.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/dec/tulip/de4x5.c