Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: bridge: fix br_vlan_get_{pvid,info} return values

These two functions return the regular -EINVAL failure in the normal
code path, but return a nonstandard '-1' error otherwise, which gets
interpreted as -EPERM.

Let's change it to -EINVAL for the dummy functions as well.

Fixes: 4d4fd36126d6 ("net: bridge: Publish bridge accessor functions")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Arnd Bergmann and committed by
David S. Miller
000244d3 843789f6

+2 -2
+2 -2
include/linux/if_bridge.h
··· 105 105 106 106 static inline int br_vlan_get_pvid(const struct net_device *dev, u16 *p_pvid) 107 107 { 108 - return -1; 108 + return -EINVAL; 109 109 } 110 110 111 111 static inline int br_vlan_get_info(const struct net_device *dev, u16 vid, 112 112 struct bridge_vlan_info *p_vinfo) 113 113 { 114 - return -1; 114 + return -EINVAL; 115 115 } 116 116 #endif 117 117