Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);