diff mbox series

[net-next,1/5] usbnet: ipheth: race between ipheth_close and error handling

Message ID 20240806172809.675044-1-forst@pen.gy (mailing list archive)
State Accepted
Commit e5876b088ba03a62124266fa20d00e65533c7269
Delegated to: Netdev Maintainers
Headers show
Series [net-next,1/5] usbnet: ipheth: race between ipheth_close and error handling | expand

Checks

Context Check Description
netdev/series_format warning Series does not have a cover letter
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
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: 29 this patch: 29
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 29 this patch: 29
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 No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 29 this patch: 29
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-06--21-00 (tests: 707)

Commit Message

Foster Snowhill Aug. 6, 2024, 5:28 p.m. UTC
From: Oliver Neukum <oneukum@suse.com>

ipheth_sndbulk_callback() can submit carrier_work
as a part of its error handling. That means that
the driver must make sure that the work is cancelled
after it has made sure that no more URB can terminate
with an error condition.

Hence the order of actions in ipheth_close() needs
to be inverted.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Foster Snowhill <forst@pen.gy>
Tested-by: Georgi Valkov <gvalkov@gmail.com>
---
v1:
  No code changes. Fixed two "ipeth" -> "ipheth" typos in commit msg.
RFC: https://lore.kernel.org/netdev/20231121144330.3990-1-oneukum@suse.com/
---
 drivers/net/usb/ipheth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Aug. 9, 2024, 1 p.m. UTC | #1
Hello:

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

On Tue,  6 Aug 2024 19:28:05 +0200 you wrote:
> From: Oliver Neukum <oneukum@suse.com>
> 
> ipheth_sndbulk_callback() can submit carrier_work
> as a part of its error handling. That means that
> the driver must make sure that the work is cancelled
> after it has made sure that no more URB can terminate
> with an error condition.
> 
> [...]

Here is the summary with links:
  - [net-next,1/5] usbnet: ipheth: race between ipheth_close and error handling
    https://git.kernel.org/netdev/net/c/e5876b088ba0
  - [net-next,2/5] usbnet: ipheth: remove extraneous rx URB length check
    https://git.kernel.org/netdev/net/c/655b46d7a39a
  - [net-next,3/5] usbnet: ipheth: drop RX URBs with no payload
    https://git.kernel.org/netdev/net/c/94d7eeb6c0ef
  - [net-next,4/5] usbnet: ipheth: do not stop RX on failing RX callback
    https://git.kernel.org/netdev/net/c/74efed51e0a4
  - [net-next,5/5] usbnet: ipheth: fix carrier detection in modes 1 and 4
    https://git.kernel.org/netdev/net/c/67927a1b255d

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 687d70cfc556..6eeef10edada 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -475,8 +475,8 @@  static int ipheth_close(struct net_device *net)
 {
 	struct ipheth_device *dev = netdev_priv(net);
 
-	cancel_delayed_work_sync(&dev->carrier_work);
 	netif_stop_queue(net);
+	cancel_delayed_work_sync(&dev->carrier_work);
 	return 0;
 }