Skip to content

Commit

Permalink
net/8021q/vlan: check the return value of vlan_vid_add()
Browse files Browse the repository at this point in the history
Check the return value of vlan_vid_add() which could fail and return
error code.

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
  • Loading branch information
FloridSleeves authored and intel-lab-lkp committed Sep 19, 2022
1 parent 9662895 commit c44a44e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/8021q/vlan.c
Expand Up @@ -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))
Expand Down

0 comments on commit c44a44e

Please sign in to comment.