aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>2019-09-30 02:22:21 -0400
committerDavid S. Miller <davem@davemloft.net>2019-10-01 13:08:30 -0400
commit93c2fcb01ae919b6e882b0931383d33aaa9bf7a6 (patch)
tree81c2368345d01d9814e10523bd4a2551b326af9c
parentf32eb9d80470dab05df26b6efd02d653c72e6a11 (diff)
devlink: Fix error handling in param and info_get dumpit cb
If any of the param or info_get op returns error, dumpit cb is skipping to dump remaining params or info_get ops for all the drivers. Fix to not return if any of the param/info_get op returns error as not supported and continue to dump remaining information. v2: Modify the patch to return error, except for params/info_get op that return -EOPNOTSUPP as suggested by Andrew Lunn. Also, modify commit message to reflect the same. Cc: Andrew Lunn <andrew@lunn.ch> Cc: Jiri Pirko <jiri@mellanox.com> Cc: Michael Chan <michael.chan@broadcom.com> Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/devlink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c
index e48680efe54a..f80151eeaf51 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -3172,7 +3172,7 @@ static int devlink_nl_cmd_param_get_dumpit(struct sk_buff *msg,
3172 NETLINK_CB(cb->skb).portid, 3172 NETLINK_CB(cb->skb).portid,
3173 cb->nlh->nlmsg_seq, 3173 cb->nlh->nlmsg_seq,
3174 NLM_F_MULTI); 3174 NLM_F_MULTI);
3175 if (err) { 3175 if (err && err != -EOPNOTSUPP) {
3176 mutex_unlock(&devlink->lock); 3176 mutex_unlock(&devlink->lock);
3177 goto out; 3177 goto out;
3178 } 3178 }
@@ -3432,7 +3432,7 @@ static int devlink_nl_cmd_port_param_get_dumpit(struct sk_buff *msg,
3432 NETLINK_CB(cb->skb).portid, 3432 NETLINK_CB(cb->skb).portid,
3433 cb->nlh->nlmsg_seq, 3433 cb->nlh->nlmsg_seq,
3434 NLM_F_MULTI); 3434 NLM_F_MULTI);
3435 if (err) { 3435 if (err && err != -EOPNOTSUPP) {
3436 mutex_unlock(&devlink->lock); 3436 mutex_unlock(&devlink->lock);
3437 goto out; 3437 goto out;
3438 } 3438 }
@@ -4088,7 +4088,7 @@ static int devlink_nl_cmd_info_get_dumpit(struct sk_buff *msg,
4088 cb->nlh->nlmsg_seq, NLM_F_MULTI, 4088 cb->nlh->nlmsg_seq, NLM_F_MULTI,
4089 cb->extack); 4089 cb->extack);
4090 mutex_unlock(&devlink->lock); 4090 mutex_unlock(&devlink->lock);
4091 if (err) 4091 if (err && err != -EOPNOTSUPP)
4092 break; 4092 break;
4093 idx++; 4093 idx++;
4094 } 4094 }