diff options
author | Dinghao Liu | 2023-09-22 17:40:44 +0800 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-10-10 22:00:42 +0200 |
commit | 6a91ec7cfd0e242d7d7537206985541e58aa8bf4 (patch) | |
tree | b31a7656e08267095c3e6e5a8f50b586802bcd51 | |
parent | f6a7182179c0ed788e3755ee2ed18c888ddcc33f (diff) |
ptp: ocp: Fix error handling in ptp_ocp_device_init
[ Upstream commit caa0578c1d487d39e4bb947a1b4965417053b409 ]
When device_add() fails, ptp_ocp_dev_release() will be called
after put_device(). Therefore, it seems that the
ptp_ocp_dev_release() before put_device() is redundant.
Fixes: 773bda964921 ("ptp: ocp: Expose various resources on the timecard.")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Vadim Feodrenko <vadim.fedorenko@linux.dev>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/ptp/ptp_ocp.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c index a48d9b7d2921..8fee9b330b61 100644 --- a/drivers/ptp/ptp_ocp.c +++ b/drivers/ptp/ptp_ocp.c @@ -3532,7 +3532,6 @@ ptp_ocp_device_init(struct ptp_ocp *bp, struct pci_dev *pdev) return 0; out: - ptp_ocp_dev_release(&bp->dev); put_device(&bp->dev); return err; } |