From: Jakub Kicinski Date: Sun, 19 Feb 2017 19:58:13 +0000 (-0800) Subject: nfp: return nfp_rtsym_read_le() errors correctly X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=372d504575cbefb34be6a934cc3d3ceb62e0892c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: David S. Miller --- 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;