From: Jay Vosburgh <jay.vosburgh@canonical.com>
To: Michael J Dilmore <michael.j.dilmore@gmail.com>
Cc: vfalico@gmail.com, andy@greyhouse.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, joe@perches.com
Subject: Re: [PATCH] Convert BUG_ON to WARN_ON in bond_options.c
Date: Wed, 21 Jun 2017 11:33:20 -0700 [thread overview]
Message-ID: <21644.1498070000@famine> (raw)
In-Reply-To: <1498068137-3550-1-git-send-email-michael.j.dilmore@gmail.com>
Michael J Dilmore <michael.j.dilmore@gmail.com> wrote:
>The function below contains a BUG_ON where no active slave is detected. The patch
>converts this to a WARN_ON to avoid crashing the kernel.
>
>Signed-off-by: Michael J Dilmore <michael.j.dilmore@gmail.com>
>---
> drivers/net/bonding/bond_options.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
>index 1bcbb89..c4b4791 100644
>--- a/drivers/net/bonding/bond_options.c
>+++ b/drivers/net/bonding/bond_options.c
>@@ -778,7 +778,7 @@ static int bond_option_active_slave_set(struct bonding *bond,
> struct slave *old_active = rtnl_dereference(bond->curr_active_slave);
> struct slave *new_active = bond_slave_get_rtnl(slave_dev);
>
>- BUG_ON(!new_active);
>+ WARN_ON(!new_active);
This is a reasonable idea in principle, but will require
additional changes to prevent dereferencing new_active if it is NULL
(which would happen just below this point in the code).
-J
> if (new_active == old_active) {
> /* do nothing */
>--
>2.7.4
>
---
-Jay Vosburgh, jay.vosburgh@canonical.com
next prev parent reply other threads:[~2017-06-21 18:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 18:02 [PATCH] Convert BUG_ON to WARN_ON in bond_options.c Michael J Dilmore
2017-06-21 18:33 ` Jay Vosburgh [this message]
2017-06-21 21:35 ` Michael D
2017-06-21 21:36 ` David Miller
2017-06-21 21:41 ` Michael D
2017-06-21 21:56 ` David Miller
2017-06-21 22:27 ` Michael J Dilmore
2017-06-21 22:39 ` Jay Vosburgh
2017-06-21 23:04 ` Michael J Dilmore
2017-06-22 8:04 ` Michal Kubecek
2017-06-22 8:14 ` Bjørn Mork
2017-06-21 22:31 ` Jay Vosburgh
2017-06-21 21:57 ` David Miller
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=21644.1498070000@famine \
--to=jay.vosburgh@canonical.com \
--cc=andy@greyhouse.net \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.j.dilmore@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=vfalico@gmail.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.