Skip to content

Commit 60a8b1a

Browse files
gal-pressmankuba-moo
authored andcommitted
net: vlan: Replace BUG() with WARN_ON_ONCE() in vlan_dev_* stubs
When CONFIG_VLAN_8021Q=n, a set of stub helpers are used, three of these helpers use BUG() unconditionally. This code should not be reached, as callers of these functions should always check for is_vlan_dev() first, but the usage of BUG() is not recommended, replace it with WARN_ON() instead. Reviewed-by: Alex Lazar <[email protected]> Reviewed-by: Dragos Tatulea <[email protected]> Signed-off-by: Gal Pressman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2de1ba0 commit 60a8b1a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/linux/if_vlan.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,19 +259,19 @@ vlan_for_each(struct net_device *dev,
259259

260260
static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
261261
{
262-
BUG();
262+
WARN_ON_ONCE(1);
263263
return NULL;
264264
}
265265

266266
static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
267267
{
268-
BUG();
268+
WARN_ON_ONCE(1);
269269
return 0;
270270
}
271271

272272
static inline __be16 vlan_dev_vlan_proto(const struct net_device *dev)
273273
{
274-
BUG();
274+
WARN_ON_ONCE(1);
275275
return 0;
276276
}
277277

0 commit comments

Comments
 (0)