mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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: 8c56df372b ("net: add support for Cavium PTP coprocessor")
Cc: Radoslaw Biernacki <[email protected]>
Cc: Aleksey Makarov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
027d351c54
commit
07a2e1cf39
1 changed files with 2 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue