diff mbox series

ptp: ocp: Fix error handling in ptp_ocp_device_init

Message ID 20230922094044.28820-1-dinghao.liu@zju.edu.cn (mailing list archive)
State Accepted
Commit caa0578c1d487d39e4bb947a1b4965417053b409
Delegated to: Netdev Maintainers
Headers show
Series ptp: ocp: Fix error handling in ptp_ocp_device_init | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1340 this patch: 1340
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 1363 this patch: 1363
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1363 this patch: 1363
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Dinghao Liu Sept. 22, 2023, 9:40 a.m. UTC
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>
---
 drivers/ptp/ptp_ocp.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Vadim Fedorenko Sept. 22, 2023, 11:28 a.m. UTC | #1
On 22/09/2023 10:40, Dinghao Liu wrote:
> 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>

Thanks!

Reviewed-by: Vadim Feodrenko <vadim.fedorenko@linux.dev>
patchwork-bot+netdevbpf@kernel.org Oct. 2, 2023, 6:20 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 22 Sep 2023 17:40:44 +0800 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - ptp: ocp: Fix error handling in ptp_ocp_device_init
    https://git.kernel.org/netdev/net/c/caa0578c1d48

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 20a974ced8d6..a7a6947ab4bc 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -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;
 }