Commit 0d8c3e77 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller

ptp_pch: fix error handling in pch_probe()

Fix to release resources when ptp_clock_register() fail instead
of return error code directly.
Signed-off-by: default avatarWei Yongjun <>
Signed-off-by: default avatarDavid S. Miller <>
parent 4d2593cc
......@@ -628,9 +628,10 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id)
chip->caps = ptp_pch_caps;
chip->ptp_clock = ptp_clock_register(&chip->caps, &pdev->dev);
if (IS_ERR(chip->ptp_clock))
return PTR_ERR(chip->ptp_clock);
if (IS_ERR(chip->ptp_clock)) {
ret = PTR_ERR(chip->ptp_clock);
goto err_ptp_clock_reg;
......@@ -669,6 +670,7 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id)
chip->regs = NULL;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment