net: cavium: fix NULL pointer dereference in cavium_ptp_put
Subsystems (2)
PATCH 1/1 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 <[email protected]>
Fixes 8c56df372bc1 ("net: add support for Cavium PTP coprocessor")
Cc Radoslaw Biernacki <[email protected]>
Cc Aleksey Makarov <[email protected]>
--- drivers/net/ethernet/cavium/common/cavium_ptp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/cavium/common/cavium_ptp.c +2 -0
@@ -75,6 +75,8 @@ EXPORT_SYMBOL(cavium_ptp_get);void cavium_ptp_put (struct cavium_ptp *ptp) { +if (!ptp) +return ;pci_dev_put (ptp->pdev); }EXPORT_SYMBOL (cavium_ptp_put);
Signature · 1 line
2.16.1
From: Jan Glauber <[email protected]>
Date: Mon, 12 Feb 2018 18:20:11 +0100
Quoted 5 lines
Prevent a kernel panic on reboot if
ptp_clockis NULL by checking the ptp pointer before using it.Signed-off-by Jan Glauber <[email protected]>Fixes 8c56df372bc1 ("net: add support for Cavium PTP coprocessor")
Applied, thank you.