[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170219195814.40471-7-jakub.kicinski@netronome.com>
Date: Sun, 19 Feb 2017 11:58:13 -0800
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: netdev@...r.kernel.org
Cc: oss-drivers@...ronome.com, dinan.gunawardena@...ronome.com,
kubakici@...pl, Jakub Kicinski <jakub.kicinski@...ronome.com>
Subject: [PATCH net-next v2 6/7] 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@...ronome.com>
---
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_rtsym.c | 8 +++++---
1 file 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;
--
2.11.0
Powered by blists - more mailing lists