[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180625073318.6828-1-cgxu519@gmx.com>
Date: Mon, 25 Jun 2018 15:33:18 +0800
From: Chengguang Xu <cgxu519@....com>
To: jakub.kicinski@...ronome.com, davem@...emloft.net
Cc: oss-drivers@...ronome.com, netdev@...r.kernel.org,
Chengguang Xu <cgxu519@....com>
Subject: [PATCH] net/nfp: cast sizeof() to int when comparing with error code
Negative error code will be larger than sizeof().
Signed-off-by: Chengguang Xu <cgxu519@....com>
---
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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))
--
2.17.1
Powered by blists - more mailing lists