Skip to content

Commit

Permalink
nfp: cast sizeof() to int when comparing with error code
Browse files Browse the repository at this point in the history
sizeof() will return unsigned value so in the error check
negative error code will be always larger than sizeof().

Fixes: a0d8e02 ("nfp: add support for reading nffw info")

Signed-off-by: Chengguang Xu <[email protected]>
Acked-by: Jakub Kicinski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Chengguang Xu authored and davem330 committed Jun 27, 2018
1 parent f3c2c5e commit 2d25957
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2d25957

Please sign in to comment.