mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
ptp: ocp: Fix error handling in ptp_ocp_device_init
[ Upstream commitcaa0578c1d] 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:773bda9649("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f6a7182179
commit
6a91ec7cfd
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user