From: Li Zhong <floridsleeves@gmail.com>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: jgg@ziepe.ca, william.xuanziyang@huawei.com, pabeni@redhat.com,
kuba@kernel.org, edumazet@google.com, davem@davemloft.net,
Li Zhong <floridsleeves@gmail.com>
Subject: [PATCH v1] net/8021q/vlan: check the return value of vlan_vid_add()
Date: Mon, 19 Sep 2022 00:46:00 -0700 [thread overview]
Message-ID: <20220919074600.1576168-1-floridsleeves@gmail.com> (raw)
Check the return value of vlan_vid_add() which could fail and return
error code.
Signed-off-by: Li Zhong <floridsleeves@gmail.com>
---
net/8021q/vlan.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index e40aa3e3641c..e96aefd00a6e 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -382,7 +382,10 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
(dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) {
pr_info("adding VLAN 0 to HW filter on device %s\n",
dev->name);
- vlan_vid_add(dev, htons(ETH_P_8021Q), 0);
+ int err = vlan_vid_add(dev, htons(ETH_P_8021Q), 0);
+
+ if (err)
+ return notifier_from_errno(err);
}
if (event == NETDEV_DOWN &&
(dev->features & NETIF_F_HW_VLAN_CTAG_FILTER))
--
2.25.1
next reply other threads:[~2022-09-19 7:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 7:46 Li Zhong [this message]
2022-09-19 12:12 ` kernel test robot
2022-09-19 15:20 ` kernel test robot
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=20220919074600.1576168-1-floridsleeves@gmail.com \
--to=floridsleeves@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jgg@ziepe.ca \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=william.xuanziyang@huawei.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®