summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSubbaraya Sundeep <sbhatta@marvell.com>2022-01-07 12:00:29 +0530
committerDavid S. Miller <davem@davemloft.net>2022-01-07 14:04:19 +0000
commit93440f4888cf049dbd22b41aaf94d2e2153b3eb8 (patch)
tree1f2ab2ca1767c78714a2fa83f8d897e9a89d99f4 /drivers
parentfff63521cd6e197738db9297076d83b4081ac80f (diff)
octeontx2-af: Increment ptp refcount before use
Before using the ptp pci device by AF driver increment the reference count of it. Fixes: a8b90c9d26d6 ("octeontx2-af: Add PTP device id for CN10K and 95O silcons") Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Signed-off-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/marvell/octeontx2/af/ptp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c
index d6321de3cc17..e682b7bfde64 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c
@@ -60,6 +60,8 @@ struct ptp *ptp_get(void)
/* Check driver is bound to PTP block */
if (!ptp)
ptp = ERR_PTR(-EPROBE_DEFER);
+ else
+ pci_dev_get(ptp->pdev);
return ptp;
}