summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2017-02-19 11:58:13 -0800
committerDavid S. Miller <davem@davemloft.net>2017-02-20 11:18:49 -0500
commit372d504575cbefb34be6a934cc3d3ceb62e0892c (patch)
tree637415b912e5504490803feb366603d558a9471c
parentaf623682ac2eba96769f9ba2270438c1f9438d7c (diff)
nfp: return nfp_rtsym_read_le() errors correctly
nfp_rtsym_read_le() has an out parameter for error codes. We have to use that instead of returning errors directly. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfpcore/nfp_rtsym.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_rtsym.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_rtsym.c
index c659b1d999be..0e3870ecfb8c 100644
--- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_rtsym.c
@@ -269,8 +269,10 @@ u64 nfp_rtsym_read_le(struct nfp_cpp *cpp, const char *name, int *error)
int err;
sym = nfp_rtsym_lookup(cpp, name);
- if (!sym)
- return -ENOENT;
+ if (!sym) {
+ err = -ENOENT;
+ goto exit;
+ }
id = NFP_CPP_ISLAND_ID(sym->target, NFP_CPP_ACTION_RW, 0, sym->domain);
@@ -294,7 +296,7 @@ u64 nfp_rtsym_read_le(struct nfp_cpp *cpp, const char *name, int *error)
err = 0;
else if (err >= 0)
err = -EIO;
-
+exit:
if (error)
*error = err;