From: Minjie Du <duminjie@vivo.com>
To: Markus.Elfring@web.de, richard@nod.at,
anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net,
sfr@canb.auug.org.au, linux-um@lists.infradead.org,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org
Cc: opensource.kernel@vivo.com, Minjie Du <duminjie@vivo.com>
Subject: [PATCH v3] um: vector: Replace undo_user_init in old code with out_free_netdev
Date: Tue, 4 Jul 2023 12:29:42 +0800 [thread overview]
Message-ID: <20230704042942.3984-1-duminjie@vivo.com> (raw)
Thanks for your response and suggestions,
I made some mistakes. This is a resubmitted patch.
I got some errors with my local repository,
so I lost the commit SHA-1 ID.
Fixes: ("drivers: use free_netdev before return in vector_eth_configure()")
Please check this link to see previous replies.
Link: https://lore.kernel.org/all/8854675f-99e7-314e-c986-8dc954ee4a27@web.de/
This patch make out_free_netdev replace undo_user_init,
fix etherdev leak in error return path.
Signed-off-by: Minjie Du <duminjie@vivo.com>
---
arch/um/drivers/vector_kern.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index 131b7cb29..7ae6ab8df 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -1646,7 +1646,7 @@ static void vector_eth_configure(
err = register_netdevice(dev);
rtnl_unlock();
if (err)
- goto out_undo_user_init;
+ goto out_free_netdev;
spin_lock(&vector_devices_lock);
list_add(&device->list, &vector_devices);
@@ -1654,8 +1654,6 @@ static void vector_eth_configure(
return;
-out_undo_user_init:
- return;
out_free_netdev:
free_netdev(dev);
out_free_device:
--
2.39.0
next reply other threads:[~2023-07-04 4:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-04 4:29 Minjie Du [this message]
2023-07-04 8:10 ` [PATCH v3] um: vector: Replace undo_user_init in old code with out_free_netdev Markus Elfring
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=20230704042942.3984-1-duminjie@vivo.com \
--to=duminjie@vivo.com \
--cc=Markus.Elfring@web.de \
--cc=anton.ivanov@cambridgegreys.com \
--cc=bpf@vger.kernel.org \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=opensource.kernel@vivo.com \
--cc=richard@nod.at \
--cc=sfr@canb.auug.org.au \
/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;
as well as URLs for NNTP newsgroup(s).