net: fec_ptp: add clock rate zero check
authorFugang Duan <fugang.duan@nxp.com>
Wed, 16 Jun 2021 09:14:25 +0000 (17:14 +0800)
committerSasha Levin <sashal@kernel.org>
Wed, 30 Jun 2021 12:48:26 +0000 (08:48 -0400)
commitb5c8467d00314d596de481bb2cea6df9fc6e030e
treed96ef713aa430e57378bd990104f1656b9a62e14
parentb838dfa48163d2f2a7de4779580ba9199a99058a
net: fec_ptp: add clock rate zero check

commit cb3cefe3f3f8af27c6076ef7d1f00350f502055d upstream.

Add clock rate zero check to fix coverity issue of "divide by 0".

Fixes: commit 85bd1798b24a ("net: fec: fix spin_lock dead lock")
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/freescale/fec_ptp.c