[patch net] switchdev: fix return value of switchdev_port_fdb_dump in case of error

Subsystems: networking [general], switchdev, the rest

STALE4067d

4 messages, 4 authors, 2015-09-06 · open the first message on its own page

[patch net] switchdev: fix return value of switchdev_port_fdb_dump in case of error

From: Jiri Pirko <jiri@resnulli.us>
Date: 2015-09-03 12:04:20

From: Jiri Pirko <redacted>

switchdev_port_fdb_dump is used as .ndo_fdb_dump. Its return value is
idx, so we cannot return errval.

Fixes: 45d4122ca7cd ("switchdev: add support for fdb add/del/dump via switchdev_port_obj ops.")
Signed-off-by: Jiri Pirko <redacted>
---
 net/switchdev/switchdev.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 16c1c43..fda38f8 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -853,12 +853,8 @@ int switchdev_port_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
 		.cb = cb,
 		.idx = idx,
 	};
-	int err;
-
-	err = switchdev_port_obj_dump(dev, &dump.obj);
-	if (err)
-		return err;
 
+	switchdev_port_obj_dump(dev, &dump.obj);
 	return dump.idx;
 }
 EXPORT_SYMBOL_GPL(switchdev_port_fdb_dump);
-- 
1.9.3

Re: [patch net] switchdev: fix return value of switchdev_port_fdb_dump in case of error

From: Samudrala, Sridhar <sridhar.samudrala@intel.com>
Date: 2015-09-03 16:59:39

On 9/3/2015 5:04 AM, Jiri Pirko wrote:
From: Jiri Pirko <redacted>

switchdev_port_fdb_dump is used as .ndo_fdb_dump. Its return value is
idx, so we cannot return errval.

Fixes: 45d4122ca7cd ("switchdev: add support for fdb add/del/dump via switchdev_port_obj ops.")
Signed-off-by: Jiri Pirko <redacted>
Acked-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
quoted hunk
---
  net/switchdev/switchdev.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 16c1c43..fda38f8 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -853,12 +853,8 @@ int switchdev_port_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
  		.cb = cb,
  		.idx = idx,
  	};
-	int err;
-
-	err = switchdev_port_obj_dump(dev, &dump.obj);
-	if (err)
-		return err;
  
+	switchdev_port_obj_dump(dev, &dump.obj);
  	return dump.idx;
  }
  EXPORT_SYMBOL_GPL(switchdev_port_fdb_dump);

Re: [patch net] switchdev: fix return value of switchdev_port_fdb_dump in case of error

From: Scott Feldman <hidden>
Date: 2015-09-03 17:35:24

On Thu, Sep 3, 2015 at 5:04 AM, Jiri Pirko [off-list ref] wrote:
From: Jiri Pirko <redacted>

switchdev_port_fdb_dump is used as .ndo_fdb_dump. Its return value is
idx, so we cannot return errval.

Fixes: 45d4122ca7cd ("switchdev: add support for fdb add/del/dump via switchdev_port_obj ops.")
Signed-off-by: Jiri Pirko <redacted>
Acked-by: Scott Feldman<redacted>

Re: [patch net] switchdev: fix return value of switchdev_port_fdb_dump in case of error

From: David Miller <davem@davemloft.net>
Date: 2015-09-06 05:02:41

From: Jiri Pirko <jiri@resnulli.us>
Date: Thu,  3 Sep 2015 14:04:17 +0200
From: Jiri Pirko <redacted>

switchdev_port_fdb_dump is used as .ndo_fdb_dump. Its return value is
idx, so we cannot return errval.

Fixes: 45d4122ca7cd ("switchdev: add support for fdb add/del/dump via switchdev_port_obj ops.")
Signed-off-by: Jiri Pirko <redacted>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help