From: Wentao Liang <liangwentao@iscas.ac.cn>
To: viro@zeniv.linux.org.uk
Cc: netdev@vger.kernel.org, Wentao Liang <liangwentao@iscas.ac.cn>
Subject: [PATCH] net: ethernet: miss media cleanup behavior
Date: Wed, 6 Nov 2024 22:11:52 +0800 [thread overview]
Message-ID: <20241106141152.1943-1-liangwentao@iscas.ac.cn> (raw)
In the de21041_media_timer(), line 1081, when media type is locked,
the code jumps to line 1136 to perform cleanup operations. However,
in the de21040_media_timer(), line 991, the same condition leads to
an immediate return without any cleanup.
To address this inconsistency, we have added a jump statement to the
de21040_media_timer() to ensure that cleanup operations are executed
before the function returns.
Signed-off-by: Wentao Liang <liangwentao@iscas.ac.cn>
---
drivers/net/ethernet/dec/tulip/de2104x.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/dec/tulip/de2104x.c b/drivers/net/ethernet/dec/tulip/de2104x.c
index 0a161a4db242..724c0b3b3966 100644
--- a/drivers/net/ethernet/dec/tulip/de2104x.c
+++ b/drivers/net/ethernet/dec/tulip/de2104x.c
@@ -988,7 +988,7 @@ static void de21040_media_timer (struct timer_list *t)
de_link_down(de);
if (de->media_lock)
- return;
+ goto set_media;
if (de->media_type == DE_MEDIA_AUI) {
static const u32 next_state = DE_MEDIA_TP;
@@ -998,6 +998,7 @@ static void de21040_media_timer (struct timer_list *t)
de_next_media(de, &next_state, 1);
}
+set_media:
spin_lock_irqsave(&de->lock, flags);
de_stop_rxtx(de);
spin_unlock_irqrestore(&de->lock, flags);
--
2.42.0.windows.2
next reply other threads:[~2024-11-06 14:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 14:11 Wentao Liang [this message]
2024-11-06 15:20 ` [PATCH] net: ethernet: miss media cleanup behavior Jiri Pirko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241106141152.1943-1-liangwentao@iscas.ac.cn \
--to=liangwentao@iscas.ac.cn \
--cc=netdev@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox