All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jay Vosburgh <jv@jvosburgh.net>
To: Minhong He <heminhong@kylinos.cn>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: bonding: check register_netdevice_notifier() error in bonding_init()
Date: Mon, 03 Aug 2026 10:32:03 -0700	[thread overview]
Message-ID: <3479489.1785778323@famine> (raw)
In-Reply-To: <20260803090012.142638-1-heminhong@kylinos.cn>

Minhong He <heminhong@kylinos.cn> wrote:

>bonding_init() ignores register_netdevice_notifier() errors and still
>returns success, which can leave the bonding module loaded without its
>netdev notifier registered.
>
>Check the error and unwind prior initialization on failure.
>
>Signed-off-by: Minhong He <heminhong@kylinos.cn>

	It appears that the matching unregister_netdevice_notifier call
in bonding_exit has the same issue, although there's probably not much
that could be done there other than printing a message.

	Regardless:

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Acked-by: Jay Vosburgh <jv@jvosburgh.net>

	-J


>---
> drivers/net/bonding/bond_main.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index e1bec8164221..3405a20bd498 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -6637,7 +6637,9 @@ static int __init bonding_init(void)
> 				flow_keys_bonding_keys,
> 				ARRAY_SIZE(flow_keys_bonding_keys));
> 
>-	register_netdevice_notifier(&bond_netdev_notifier);
>+	res = register_netdevice_notifier(&bond_netdev_notifier);
>+	if (res)
>+		goto err;
> out:
> 	return res;
> err:
>-- 
>2.25.1

---
	-Jay Vosburgh, jv@jvosburgh.net

  reply	other threads:[~2026-08-03 17:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03  9:00 [PATCH net] net: bonding: check register_netdevice_notifier() error in bonding_init() Minhong He
2026-08-03 17:32 ` Jay Vosburgh [this message]
2026-08-05  2:10 ` patchwork-bot+netdevbpf

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=3479489.1785778323@famine \
    --to=jv@jvosburgh.net \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=heminhong@kylinos.cn \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.