nfp: cast sizeof() to int when comparing with error code
[ Upstream commit 2d2595719a97c876f35b1e60e5768e58753b268c ] 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> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a5b6bb86cc
commit
778bce908b
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user