mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] net: bridge: fix br_vlan_get_{pvid,info} return values
@ 2018-07-06 12:44 Arnd Bergmann
  2018-07-06 12:51 ` Nikolay Aleksandrov
  2018-07-07 11:05 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-07-06 12:44 UTC (permalink / raw)
  To: David S. Miller
  Cc: Arnd Bergmann, Nikolay Aleksandrov, Jiri Pirko, Yotam Gigi,
	Roopa Prabhu, Petr Machata, netdev, linux-kernel

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>
---
 include/linux/if_bridge.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 7843b98e1c6e..c20c7e197d07 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -105,13 +105,13 @@ static inline bool br_vlan_enabled(const struct net_device *dev)
 
 static inline int br_vlan_get_pvid(const struct net_device *dev, u16 *p_pvid)
 {
-	return -1;
+	return -EINVAL;
 }
 
 static inline int br_vlan_get_info(const struct net_device *dev, u16 vid,
 				   struct bridge_vlan_info *p_vinfo)
 {
-	return -1;
+	return -EINVAL;
 }
 #endif
 
-- 
2.9.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: bridge: fix br_vlan_get_{pvid,info} return values
  2018-07-06 12:44 [PATCH net] net: bridge: fix br_vlan_get_{pvid,info} return values Arnd Bergmann
@ 2018-07-06 12:51 ` Nikolay Aleksandrov
  2018-07-07 11:05 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Nikolay Aleksandrov @ 2018-07-06 12:51 UTC (permalink / raw)
  To: Arnd Bergmann, David S. Miller
  Cc: Jiri Pirko, Yotam Gigi, Roopa Prabhu, Petr Machata, netdev, linux-kernel

On 06/07/18 15:44, Arnd Bergmann wrote:
> 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>
> ---
>  include/linux/if_bridge.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
> index 7843b98e1c6e..c20c7e197d07 100644
> --- a/include/linux/if_bridge.h
> +++ b/include/linux/if_bridge.h
> @@ -105,13 +105,13 @@ static inline bool br_vlan_enabled(const struct net_device *dev)
>  
>  static inline int br_vlan_get_pvid(const struct net_device *dev, u16 *p_pvid)
>  {
> -	return -1;
> +	return -EINVAL;
>  }
>  
>  static inline int br_vlan_get_info(const struct net_device *dev, u16 vid,
>  				   struct bridge_vlan_info *p_vinfo)
>  {
> -	return -1;
> +	return -EINVAL;
>  }
>  #endif
>  
> 

Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: bridge: fix br_vlan_get_{pvid,info} return values
  2018-07-06 12:44 [PATCH net] net: bridge: fix br_vlan_get_{pvid,info} return values Arnd Bergmann
  2018-07-06 12:51 ` Nikolay Aleksandrov
@ 2018-07-07 11:05 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-07-07 11:05 UTC (permalink / raw)
  To: arnd; +Cc: nikolay, jiri, yotamg, roopa, petrm, netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>
Date: Fri,  6 Jul 2018 14:44:02 +0200

> 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>

Applied, thanks Arnd.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-07 11:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-06 12:44 [PATCH net] net: bridge: fix br_vlan_get_{pvid,info} return values Arnd Bergmann
2018-07-06 12:51 ` Nikolay Aleksandrov
2018-07-07 11:05 ` David Miller

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®