netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ptp: ocp: Fix error handling in ptp_ocp_device_init
@ 2023-09-22  9:40 Dinghao Liu
  2023-09-22 11:28 ` Vadim Fedorenko
  2023-10-02  6:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Dinghao Liu @ 2023-09-22  9:40 UTC (permalink / raw)
  To: dinghao.liu
  Cc: Richard Cochran, Jonathan Lemon, Vadim Fedorenko, David S. Miller,
	netdev, linux-kernel

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(-)

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;
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ptp: ocp: Fix error handling in ptp_ocp_device_init
  2023-09-22  9:40 [PATCH] ptp: ocp: Fix error handling in ptp_ocp_device_init Dinghao Liu
@ 2023-09-22 11:28 ` Vadim Fedorenko
  2023-10-02  6:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Vadim Fedorenko @ 2023-09-22 11:28 UTC (permalink / raw)
  To: Dinghao Liu
  Cc: Richard Cochran, Jonathan Lemon, Vadim Fedorenko, David S. Miller,
	netdev, linux-kernel

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>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ptp: ocp: Fix error handling in ptp_ocp_device_init
  2023-09-22  9:40 [PATCH] ptp: ocp: Fix error handling in ptp_ocp_device_init Dinghao Liu
  2023-09-22 11:28 ` Vadim Fedorenko
@ 2023-10-02  6:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-02  6:20 UTC (permalink / raw)
  To: Dinghao Liu
  Cc: richardcochran, jonathan.lemon, vadfed, davem, netdev,
	linux-kernel

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-02  6:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-22  9:40 [PATCH] ptp: ocp: Fix error handling in ptp_ocp_device_init Dinghao Liu
2023-09-22 11:28 ` Vadim Fedorenko
2023-10-02  6:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).