Commit 07a2e1cf authored by Jan Glauber's avatar Jan Glauber Committed by David S. Miller

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: default avatarJan Glauber <jglauber@cavium.com>
Fixes: 8c56df37 ("net: add support for Cavium PTP coprocessor")
Cc: Radoslaw Biernacki <rad@semihalf.com>
Cc: Aleksey Makarov <aleksey.makarov@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 027d351c
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment