]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: vlan: Replace BUG() with WARN_ON_ONCE() in vlan_dev_* stubs
authorGal Pressman <gal@nvidia.com>
Mon, 16 Jun 2025 13:26:25 +0000 (16:26 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:23 +0000 (16:28 +0200)
commita1172cbfe51cef2d8399f6c5233fc9d030a455f2
treec04df74b4f49b058e4de6401e1c8427d6cc34b58
parent8d1f4798c876c99c625a010eb68253e87a769997
net: vlan: Replace BUG() with WARN_ON_ONCE() in vlan_dev_* stubs

[ Upstream commit 60a8b1a5d0824afda869f18dc0ecfe72f8dfda42 ]

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 <alazar@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Link: https://patch.msgid.link/20250616132626.1749331-3-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/if_vlan.h