Skip to content

Commit

Permalink
ptp: ocp: Fix error handling in ptp_ocp_device_init
Browse files Browse the repository at this point in the history
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: 773bda9 ("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>
  • Loading branch information
Dinghao Liu authored and David S. Miller committed Oct 2, 2023
1 parent c889a99 commit caa0578
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/ptp/ptp_ocp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3998,7 +3998,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;
}
Expand Down

0 comments on commit caa0578

Please sign in to comment.