nfp: fix readq on absolute RTsyms
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 4 Sep 2018 14:37:31 +0000 (07:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Sep 2018 05:17:07 +0000 (22:17 -0700)
Return the error and report value through the output param.

Fixes: 640917dd81b6 ("nfp: support access to absolute RTsyms")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Francois H. Theron <francois.theron@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_rtsym.c

index 108ce8c5e68eb434038cd848b5208db6431723ea..4003ed76a49a064c4b1c7a580c79e167d4cdcdbb 100644 (file)
@@ -337,8 +337,10 @@ int __nfp_rtsym_readq(struct nfp_cpp *cpp, const struct nfp_rtsym *sym,
        u64 addr;
        int err;
 
-       if (sym->type == NFP_RTSYM_TYPE_ABS)
-               return sym->addr;
+       if (sym->type == NFP_RTSYM_TYPE_ABS) {
+               *value = sym->addr;
+               return 0;
+       }
 
        err = nfp_rtsym_to_dest(cpp, sym, action, token, off, &cpp_id, &addr);
        if (err)