diff options
author | Chengguang Xu <cgxu519@gmx.com> | 2018-06-26 03:16:31 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-27 08:36:32 +0200 |
commit | 2d2595719a97c876f35b1e60e5768e58753b268c (patch) | |
tree | 5e6181ee6b05e5289bcb039d97a02063b9a7c9aa | |
parent | Merge branch 'nfp-MPLS-and-shared-blocks-TC-offload-fixes' (diff) | |
download | linux-2d2595719a97c876f35b1e60e5768e58753b268c.tar.xz linux-2d2595719a97c876f35b1e60e5768e58753b268c.zip |
nfp: cast sizeof() to int when comparing with error code
sizeof() will return unsigned value so in the error check
negative error code will be always larger than sizeof().
Fixes: a0d8e02c35ff ("nfp: add support for reading nffw info")
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Acked-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_nffw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c index cd34097b79f1..37a6d7822a38 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c @@ -232,7 +232,7 @@ struct nfp_nffw_info *nfp_nffw_info_open(struct nfp_cpp *cpp) err = nfp_cpp_read(cpp, nfp_resource_cpp_id(state->res), nfp_resource_address(state->res), fwinf, sizeof(*fwinf)); - if (err < sizeof(*fwinf)) + if (err < (int)sizeof(*fwinf)) goto err_release; if (!nffw_res_flg_init_get(fwinf)) |