net: cavium: fix NULL pointer dereference in cavium_ptp_put
authorJan Glauber <jglauber@cavium.com>
Mon, 12 Feb 2018 17:20:11 +0000 (18:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Feb 2018 19:38:37 +0000 (14:38 -0500)
commit07a2e1cf398187814b405665b19d36425ec7a962
treed415d4b6dd9e61f2d679f82dfb9d521755e73427
parent027d351c541744c0c780dd5801c63e4b90750b90
net: cavium: fix NULL pointer dereference in cavium_ptp_put

Prevent a kernel panic on reboot if ptp_clock is NULL by checking
the ptp pointer before using it.

Signed-off-by: Jan Glauber <jglauber@cavium.com>
Fixes: 8c56df372bc1 ("net: add support for Cavium PTP coprocessor")
Cc: Radoslaw Biernacki <rad@semihalf.com>
Cc: Aleksey Makarov <aleksey.makarov@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/common/cavium_ptp.c