Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set()
@ 2021-11-29 15:16 Wei Yongjun
  2021-11-29 15:17 ` Vladimir Oltean
  2021-11-30  4:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2021-11-29 15:16 UTC (permalink / raw)
  To: weiyongjun1, Vladimir Oltean, Claudiu Manoil, Alexandre Belloni,
	UNGLinuxDriver, David S. Miller, Jakub Kicinski, Russell King
  Cc: netdev, kernel-janitors, Hulk Robot

Add the missing mutex_unlock before return from function
ocelot_hwstamp_set() in the ocelot_setup_ptp_traps() error
handling case.

Fixes: 96ca08c05838 ("net: mscc: ocelot: set up traps for PTP packets")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/ethernet/mscc/ocelot.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index fe8abb30f185..b1856d8c944b 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -1651,8 +1651,10 @@ int ocelot_hwstamp_set(struct ocelot *ocelot, int port, struct ifreq *ifr)
 	}
 
 	err = ocelot_setup_ptp_traps(ocelot, port, l2, l4);
-	if (err)
+	if (err) {
+		mutex_unlock(&ocelot->ptp_lock);
 		return err;
+	}
 
 	if (l2 && l4)
 		cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;


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

* Re: [PATCH net-next] net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set()
  2021-11-29 15:16 [PATCH net-next] net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set() Wei Yongjun
@ 2021-11-29 15:17 ` Vladimir Oltean
  2021-11-30  4:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Oltean @ 2021-11-29 15:17 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Claudiu Manoil, Alexandre Belloni, UNGLinuxDriver@microchip.com,
	David S. Miller, Jakub Kicinski, Russell King,
	netdev@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Hulk Robot

On Mon, Nov 29, 2021 at 03:16:52PM +0000, Wei Yongjun wrote:
> Add the missing mutex_unlock before return from function
> ocelot_hwstamp_set() in the ocelot_setup_ptp_traps() error
> handling case.
> 
> Fixes: 96ca08c05838 ("net: mscc: ocelot: set up traps for PTP packets")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

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

* Re: [PATCH net-next] net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set()
  2021-11-29 15:16 [PATCH net-next] net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set() Wei Yongjun
  2021-11-29 15:17 ` Vladimir Oltean
@ 2021-11-30  4:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-11-30  4:30 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: vladimir.oltean, claudiu.manoil, alexandre.belloni,
	UNGLinuxDriver, davem, kuba, linux, netdev, kernel-janitors,
	hulkci

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 29 Nov 2021 15:16:52 +0000 you wrote:
> Add the missing mutex_unlock before return from function
> ocelot_hwstamp_set() in the ocelot_setup_ptp_traps() error
> handling case.
> 
> Fixes: 96ca08c05838 ("net: mscc: ocelot: set up traps for PTP packets")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> 
> [...]

Here is the summary with links:
  - [net-next] net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set()
    https://git.kernel.org/netdev/net/c/1a59c9c55585

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:[~2021-11-30  4:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-29 15:16 [PATCH net-next] net: mscc: ocelot: fix missing unlock on error in ocelot_hwstamp_set() Wei Yongjun
2021-11-29 15:17 ` Vladimir Oltean
2021-11-30  4:30 ` 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