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 07:46:54 +0000 (08:46 +0100)
commitd3dedaa5a601107cfedda087209772c76e364d58
tree1bae4de692ac141ba18378812c256c1a55bbfde7
parentabbd5faa0748d0aa95d5191d56ff7a17a6275bd1
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