[PATCH v2 net] nfp: cast sizeof() to int when comparing with error code

2018-06-25 Thread Chengguang Xu
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 Acked-by: Jakub Kicinski --- v2: - Add more information to patch subject and

[PATCH] net/nfp: cast sizeof() to int when comparing with error code

2018-06-25 Thread Chengguang Xu
Negative error code will be larger than sizeof(). Signed-off-by: Chengguang Xu --- 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

[PATCH] net/9p: fix potential refcnt problem of trans module

2018-03-27 Thread Chengguang Xu
When specifying trans_mod multiple times in a mount, it may cause inaccurate refcount of trans module. Also, in the error case of option parsing, we should put the trans module if we have already got. Signed-off-by: Chengguang Xu --- net/9p/client.c | 5 - 1 file changed, 4 insertions(+), 1

[PATCH] ceph: Check memory allocation result

2018-01-25 Thread Chengguang Xu
Should check result of kstrndup() in case of memory allocation failure. Signed-off-by: Chengguang Xu --- net/ceph/ceph_common.c | 4 1 file changed, 4 insertions(+) diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c index 5c036d2..1e492ef 100644 --- a/net/ceph/ceph_common.c