devlink: ignore -EOPNOTSUPP errors on dumpit
authorJakub Kicinski <kuba@kernel.org>
Tue, 28 Jul 2020 23:15:07 +0000 (16:15 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Jul 2020 23:51:53 +0000 (16:51 -0700)
commit82274d075536322368ce710b211c41c37c4740b9
tree45413c09e352562570d5ec21ad37441e117bc3c3
parent65550098c1c4db528400c73acf3e46bfa78d9264
devlink: ignore -EOPNOTSUPP errors on dumpit

Number of .dumpit functions try to ignore -EOPNOTSUPP errors.
Recent change missed that, and started reporting all errors
but -EMSGSIZE back from dumps. This leads to situation like
this:

$ devlink dev info
devlink answers: Operation not supported

Dump should not report an error just because the last device
to be queried could not provide an answer.

To fix this and avoid similar confusion make sure we clear
err properly, and not leave it set to an error if we don't
terminate the iteration.

Fixes: c62c2cfb801b ("net: devlink: don't ignore errors during dumpit")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c