Re: [PATCH] cxgb4: fix invalid checks in alloc_uld_rxqs

2016-08-23 Thread Andrzej Hajda
On 08/23/2016 09:46 AM, Hariprasad Shenai wrote: > On Tuesday, August 08/23/16, 2016 at 08:16:19 +0200, Andrzej Hajda wrote: >> Local variable msi_idx defined as unsigned int is always >= 0, thus both >> 'if' checks are always true. On the other side presence of USI

[PATCH] cxgb4: fix invalid checks in alloc_uld_rxqs

2016-08-22 Thread Andrzej Hajda
flags and remove spare variables. The problem has been detected using semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci Signed-off-by: Andrzej Hajda --- Hi, I am not familiar with the code, and it is not clear to me, so my solution can be incorrect, anyway there is an issu

Re: [PATCH] kcm: fix variable type

2016-03-13 Thread Andrzej Hajda
On 03/11/2016 05:44 PM, David Miller wrote: > From: Andrzej Hajda > Date: Fri, 11 Mar 2016 07:51:15 +0100 > >> Function skb_splice_bits can return negative values, its result should >> be assigned to signed variable to allow correct error checking. >> >> The prob

[PATCH] kcm: fix variable type

2016-03-10 Thread Andrzej Hajda
Function skb_splice_bits can return negative values, its result should be assigned to signed variable to allow correct error checking. The problem has been detected using patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci. Signed-off-by: Andrzej Hajda --- net/kcm/kcmsock.c | 2

[PATCH] stmmac: Fix type of local variable in stmmac_xmit

2016-03-03 Thread Andrzej Hajda
/unsigned_lesser_than_zero.cocci. Signed-off-by: Andrzej Hajda --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 4c5ce98..cd31a3c 100644 --- a

[PATCH 0/7] fix IS_ERR_VALUE usage

2016-02-15 Thread Andrzej Hajda
et) [1]: http://permalink.gmane.org/gmane.linux.kernel/2120927 [2]: http://permalink.gmane.org/gmane.linux.kernel/2150581 Regards Andrzej Andrzej Hajda (7): netfilter: fix IS_ERR_VALUE usage MIPS: module: fix incorrect IS_ERR_VALUE macro usages drivers: char: mem: fix IS_ERROR_VALUE usage atmel-isi:

[PATCH] wlcore: fix error handling in wlcore_event_fw_logger

2016-01-07 Thread Andrzej Hajda
: 3719c17e1816 ("wlcore/wl18xx: fw logger over sdio") Signed-off-by: Andrzej Hajda --- drivers/net/wireless/ti/wlcore/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ti/wlcore/event.c b/drivers/net/wireless/ti/wlcore/event.c index c964054..4b59f67 10

[PATCH] net/mlx4_core: fix handling return value of mlx4_slave_convert_port

2015-12-14 Thread Andrzej Hajda
: Andrzej Hajda --- drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index da7f578..b46dbe2 100644 --- a/drivers/net

[PATCH] ath9k_htc: fix handling return value of ath9k_hw_calibrate

2015-12-14 Thread Andrzej Hajda
-off-by: Andrzej Hajda --- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index a680a97..fe1fd1a 100644 --- a/drivers/net/wireless/ath

[PATCH] bna: fix error handling

2015-09-28 Thread Andrzej Hajda
://permalink.gmane.org/gmane.linux.kernel/2046107 Signed-off-by: Andrzej Hajda --- drivers/net/ethernet/brocade/bna/bfa_ioc.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.c b/drivers/net/ethernet/brocade/bna/bfa_ioc.c

[PATCH v2 17/19] tools: bpf_jit_disasm: make get_last_jit_image return unsigned

2015-09-24 Thread Andrzej Hajda
The function returns always non-negative values. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 Signed-off-by: Andrzej Hajda --- v2: fixed indentation

[PATCH v2 18/19] mac80211: make ieee80211_new_mesh_header return unsigned

2015-09-24 Thread Andrzej Hajda
The function returns always non-negative values. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 Signed-off-by: Andrzej Hajda --- v2: added missing declaration

[PATCH 01/19] SUNRPC: fix variable type

2015-09-24 Thread Andrzej Hajda
Due to incorrect len type bc_send_request returned always zero. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 Signed-off-by: Andrzej Hajda --- Hi, To avoid

[PATCH 18/19] mac80211: make ieee80211_new_mesh_header return unsigned

2015-09-24 Thread Andrzej Hajda
The function returns always non-negative values. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 Signed-off-by: Andrzej Hajda --- Hi, To avoid problems with too

[PATCH 16/19] r8169: fix handling rtl_readphy result

2015-09-24 Thread Andrzej Hajda
The function can return negative value. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 Signed-off-by: Andrzej Hajda --- Hi, To avoid problems with too many

[PATCH 07/19] net: hisilicon: fix handling platform_get_irq result

2015-09-24 Thread Andrzej Hajda
The function can return negative value. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 Signed-off-by: Andrzej Hajda --- Hi, To avoid problems with too many

[PATCH 17/19] tools: bpf_jit_disasm: make get_last_jit_image return unsigned

2015-09-24 Thread Andrzej Hajda
The function returns always non-negative values. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 Signed-off-by: Andrzej Hajda --- Hi, To avoid problems with too

Re: [PATCH 00/38] Fixes related to incorrect usage of unsigned types

2015-09-22 Thread Andrzej Hajda
On 09/21/2015 03:42 PM, David Howells wrote: > Andrzej Hajda wrote: > >> Semantic patch finds comparisons of types: >> unsigned < 0 >> unsigned >= 0 >> The former is always false, the latter is always true. >> Such comparisons are useless, so the

[PATCH 08/38] openvswitch: fix handling result of ipv6_skip_exthdr

2015-09-21 Thread Andrzej Hajda
The function can return negative value. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- net/openvswitch/conntrack.c | 2 +- 1

[PATCH 18/38] net/ibm/emac: fix type of phy_mode

2015-09-21 Thread Andrzej Hajda
phy_mode can be negative. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- drivers/net/ethernet/ibm/emac/core.h | 2 +- 1 file

[PATCH 19/38] net: stmmac: fix type of entry variable

2015-09-21 Thread Andrzej Hajda
Variable can store negative values. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- drivers/net/ethernet/stmicro/stmmac

[PATCH 17/38] isdn: hisax: fix frame calculation

2015-09-21 Thread Andrzej Hajda
Difference of unsigned values is also unsigned so it does not make sense to check its sign. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej

[PATCH 20/38] net: brcm80211: fix range check

2015-09-21 Thread Andrzej Hajda
Unsigned minus constant is still unsigned so checking its sign makes no sense. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda

[PATCH 23/38] rndis_wlan: fix checking for default value

2015-09-21 Thread Andrzej Hajda
/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- drivers/net/wireless/rndis_wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 71a825c..a13d1f2 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b

[PATCH 21/38] mwifiex: fix comparison expression

2015-09-21 Thread Andrzej Hajda
To avoid underflows signed variables should be used in expression. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- drivers/net

[PATCH 27/38] usbnet: remove invalid check

2015-09-21 Thread Andrzej Hajda
skb->len is always non-negative. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- drivers/net/usb/lan78xx.c | 5 - driv

[PATCH 22/38] orinoco: fix checking for default value

2015-09-21 Thread Andrzej Hajda
/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- drivers/net/wireless/orinoco/cfg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/orinoco/cfg.c b/drivers/net/wireless/orinoco/cfg.c index a9e94b6..0f6ea31 100644 --- a/drivers/net/wireless/orinoco/cfg.c

Re: [PATCH 27/31] net/tipc: use kmemdup rather than duplicating its implementation

2015-09-16 Thread Andrzej Hajda
Ping. Regards Andrzej On 08/07/2015 09:59 AM, Andrzej Hajda wrote: > The patch was generated using fixed coccinelle semantic patch > scripts/coccinelle/api/memdup.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 > > Signed-off-by: Andrzej Hajda

Re: [PATCH 16/31] net/cavium/liquidio: use kmemdup rather than duplicating its implementation

2015-09-16 Thread Andrzej Hajda
Ping. Regards Andrzej On 08/07/2015 09:59 AM, Andrzej Hajda wrote: > The patch was generated using fixed coccinelle semantic patch > scripts/coccinelle/api/memdup.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 > > Signed-off-by: Andrzej Hajda &g

[PATCH 16/31] net/cavium/liquidio: use kmemdup rather than duplicating its implementation

2015-08-07 Thread Andrzej Hajda
The patch was generated using fixed coccinelle semantic patch scripts/coccinelle/api/memdup.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 Signed-off-by: Andrzej Hajda --- drivers/net/ethernet/cavium/liquidio/octeon_device.c | 4 +--- 1 file changed, 1 insertion(+), 3

[PATCH 26/31] net/sched: use kmemdup rather than duplicating its implementation

2015-08-07 Thread Andrzej Hajda
The patch was generated using fixed coccinelle semantic patch scripts/coccinelle/api/memdup.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 Signed-off-by: Andrzej Hajda --- net/sched/act_bpf.c | 4 +--- net/sched/cls_bpf.c | 4 +--- 2 files changed, 2 insertions(+), 6

[PATCH 27/31] net/tipc: use kmemdup rather than duplicating its implementation

2015-08-07 Thread Andrzej Hajda
The patch was generated using fixed coccinelle semantic patch scripts/coccinelle/api/memdup.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 Signed-off-by: Andrzej Hajda --- net/tipc/server.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/tipc

[PATCH 28/31] net/xfrm: use kmemdup rather than duplicating its implementation

2015-08-07 Thread Andrzej Hajda
The patch was generated using fixed coccinelle semantic patch scripts/coccinelle/api/memdup.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 Signed-off-by: Andrzej Hajda --- net/xfrm/xfrm_user.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net