From: Jiri Pirko Date: Thu, 3 Sep 2015 12:04:17 +0000 (+0200) Subject: switchdev: fix return value of switchdev_port_fdb_dump in case of error X-Git-Tag: v4.3-rc1~28^2~45 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0890cf6cb6ab;p=karo-tx-linux.git switchdev: fix return value of switchdev_port_fdb_dump in case of error 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 Acked-by: Sridhar Samudrala Acked-by: Scott Feldman Signed-off-by: David S. Miller --- diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 16c1c43980a1..fda38f830a10 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);