Skip to content

Commit

Permalink
switchdev: fix return value of switchdev_port_fdb_dump in case of error
Browse files Browse the repository at this point in the history
switchdev_port_fdb_dump is used as .ndo_fdb_dump. Its return value is
idx, so we cannot return errval.

Fixes: 45d4122 ("switchdev: add support for fdb add/del/dump via switchdev_port_obj ops.")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
Acked-by: Scott Feldman<sfeldma@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Sep 6, 2015
1 parent b658887 commit 0890cf6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions net/switchdev/switchdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0890cf6

Please sign in to comment.