From: Shigeru Yoshida <syoshida@redhat.com>
To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Shigeru Yoshida <syoshida@redhat.com>
Subject: [PATCH net] macvlan: Return error on register_netdevice_notifier() failure
Date: Wed, 24 Jul 2024 22:56:22 +0900 [thread overview]
Message-ID: <20240724135622.1797145-1-syoshida@redhat.com> (raw)
register_netdevice_notifier() may fail, but macvlan_init_module() does
not handle the failure. Handle the failure by returning an error.
Fixes: b863ceb7ddce ("[NET]: Add macvlan driver")
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
---
drivers/net/macvlan.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 24298a33e0e9..ae2f1a8325a5 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -1849,7 +1849,9 @@ static int __init macvlan_init_module(void)
{
int err;
- register_netdevice_notifier(&macvlan_notifier_block);
+ err = register_netdevice_notifier(&macvlan_notifier_block);
+ if (err < 0)
+ return err;
err = macvlan_link_register(&macvlan_link_ops);
if (err < 0)
--
2.45.2
next reply other threads:[~2024-07-24 13:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 13:56 Shigeru Yoshida [this message]
2024-07-24 18:40 ` Simon Horman
2024-07-25 9:44 ` Eric Dumazet
2024-07-25 10:13 ` Paolo Abeni
2024-07-25 11:53 ` Eric Dumazet
2024-07-25 14:05 ` Shigeru Yoshida
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=20240724135622.1797145-1-syoshida@redhat.com \
--to=syoshida@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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
all inboxes | Powered by JetHome®