[PATCH] net: davinci_emac: Fix incorrect masking of tx and rx error channel

2021-04-20 Thread Colin King
From: Colin Ian King The bit-masks used for the TXERRCH and RXERRCH (tx and rx error channels) are incorrect and always lead to a zero result. The mask values are currently the incorrect post-right shifted values, fix this by setting them to the currect values. (I double checked these against th

[PATCH][next] net: mana: remove redundant initialization of variable err

2021-04-20 Thread Colin King
From: Colin Ian King The variable err is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/net/ethernet/microsoft/m

[PATCH][next][V2] wlcore: Fix buffer overrun by snprintf due to incorrect buffer size

2021-04-19 Thread Colin King
From: Colin Ian King The size of the buffer than can be written to is currently incorrect, it is always the size of the entire buffer even though the snprintf is writing as position pos into the buffer. Fix this by setting the buffer size to be the number of bytes left in the buffer, namely sizeo

[PATCH][next] wlcore: Fix buffer overrun by snprintf due to incorrect buffer size Content-Type: text/plain; charset="utf-8"

2021-04-19 Thread Colin King
From: Colin Ian King The size of the buffer than can be written to is currently incorrect, it is always the size of the entire buffer even though the snprintf is writing as position pos into the buffer. Fix this by setting the buffer size to be the number of bytes left in the buffer, namely sizeo

[PATCH][next] mt76: mt7615: Fix a dereference of pointer sta before it is null checked

2021-04-19 Thread Colin King
From: Colin Ian King Currently the assignment of idx dereferences pointer sta before sta is null checked, leading to a potential null pointer dereference. Fix this by assigning idx when it is required after the null check on pointer sta. Addresses-Coverity: ("Dereference before null check") Fixe

[PATCH] mac80211: minstrel_ht: remove extraneous indentation on if statement

2021-04-16 Thread Colin King
From: Colin Ian King The increment of idx is indented one level too deeply, clean up the code by removing the extraneous tab. Signed-off-by: Colin Ian King --- net/mac80211/rc80211_minstrel_ht.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/rc80211_minstrel_h

[PATCH][next] can: etas_es58x: Fix a couple of spelling mistakes

2021-04-15 Thread Colin King
From: Colin Ian King There are spelling mistakes in netdev_dbg and netdev_dbg messages, fix these. Signed-off-by: Colin Ian King --- drivers/net/can/usb/etas_es58x/es58x_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c

[PATCH][next] can: etas_es58x: Fix potential null pointer dereference on pointer cf

2021-04-15 Thread Colin King
From: Colin Ian King The pointer cf is being null checked earlier in the code, however the update of the rx_bytes statistics is dereferencing cf without null checking cf. Fix this by moving the statement into the following code block that has a null cf check. Addresses-Coverity: ("Dereference a

[PATCH][next] can: etas_es58x: Fix missing null check on netdev pointer

2021-04-15 Thread Colin King
From: Colin Ian King There is an assignment to *netdev that is can potentially be null but the null check is checking netdev and not *netdev as intended. Fix this by adding in the missing * operator. Addresses-Coverity: ("Dereference before null check") Fixes: 8537257874e9 ("can: etas_es58x: add

[PATCH][next] net: stmmac: replace redundant comparison with true

2021-04-15 Thread Colin King
From: Colin Ian King The comparison of the u32 variable queue with <= zero is always true since an unsigned can never be negative. Replace the conditional check with the boolean true to simplify the code. The while loop will terminate because of the zero check on queue before queue is decremente

[PATCH][next] net: hns3: Fix potential null pointer defererence of null ae_dev

2021-04-09 Thread Colin King
From: Colin Ian King The reset_prepare and reset_done calls have a null pointer check on ae_dev however ae_dev is being dereferenced via the call to ns3_is_phys_func with the ae->pdev argument. Fix this by performing a null pointer check on ae_dev and hence short-circuiting the dereference to ae_

[PATCH] net: thunderx: Fix unintentional sign extension issue

2021-04-09 Thread Colin King
From: Colin Ian King The shifting of the u8 integers rq->caching by 26 bits to the left will be promoted to a 32 bit signed int and then sign-extended to a u64. In the event that rq->caching is greater than 0x1f then all then all the upper 32 bits of the u64 end up as also being set because of th

[PATCH] cxgb4: Fix unintentional sign extension issues

2021-04-09 Thread Colin King
From: Colin Ian King The shifting of the u8 integers f->fs.nat_lip[] by 24 bits to the left will be promoted to a 32 bit signed int and then sign-extended to a u64. In the event that the top bit of the u8 is set then all then all the upper 32 bits of the u64 end up as also being set because of th

[PATCH] net: sched: Fix potential infinite loop

2021-04-07 Thread Colin King
From: Colin Ian King The for-loop iterates with a u16 loop counter idx and compares this with the loop upper limit of q->flows_cnt that is a u32 type. There is a potential infinite loop if q->flows_cnt is larger than the u8 loop counter. Fix this by making the loop counter the same type as q->flo

[PATCH] bnx2x: Fix potential infinite loop

2021-04-07 Thread Colin King
From: Colin Ian King The for_each_tx_queue loop iterates with a u8 loop counter i and compares this with the loop upper limit of bp->num_queues that is an int type. There is a potential infinite loop if bp->num_queues is larger than the u8 loop counter. Fix this by making the loop counter the sa

[PATCH] liquidio: Fix unintented sign extension of a left shift of a u16

2021-04-07 Thread Colin King
From: Colin Ian King The macro CN23XX_PEM_BAR1_INDEX_REG is being used to shift oct->pcie_port (a u16) left 24 places. There are two subtle issues here, first the shift gets promoted to an signed int and then sign extended to a u64. If oct->pcie_port is 0x80 or more then the upper bits get sign e

[PATCH] xircom: remove redundant error check on variable err

2021-04-07 Thread Colin King
From: Colin Ian King The error check on err is always false as err is always 0 at the port_found label. The code is redundant and can be removed. Addresses-Coverity: ("Logically dead code") Signed-off-by: Colin Ian King --- drivers/net/ethernet/xircom/xirc2ps_cs.c | 2 -- 1 file changed, 2 del

[PATCH][next] net/mlx5: Fix bit-wise and with zero

2021-04-06 Thread Colin King
From: Colin Ian King The bit-wise and of the action field with MLX5_ACCEL_ESP_ACTION_DECRYPT is incorrect as MLX5_ACCEL_ESP_ACTION_DECRYPT is zero and not intended to be a bit-flag. Fix this by using the == operator as was originally intended. Addresses-Coverity: ("Logically dead code") Fixes: 7

[PATCH][next] ice: Fix potential infinite loop when using u8 loop counter

2021-03-31 Thread Colin King
From: Colin Ian King A for-loop is using a u8 loop counter that is being compared to a u32 cmp_dcbcfg->numapp to check for the end of the loop. If cmp_dcbcfg->numapp is larger than 255 then the counter j will wrap around to zero and hence an infinite loop occurs. Fix this by making counter j the

[PATCH][next] netfilter: nf_log_bridge: Fix missing assignment of ret on a call to nf_log_register

2021-03-31 Thread Colin King
From: Colin Ian King Currently the call to nf_log_register is returning an error code that is not being assigned to ret and yet ret is being checked. Fix this by adding in the missing assignment. Addresses-Coverity: ("Logically dead code") Fixes: 8d02e7da87a0 ("netfilter: nf_log_bridge: merge wi

[PATCH] ieee802154: hwsim: remove redundant initialization of variable res

2021-03-29 Thread Colin King
From: Colin Ian King The variable res is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/net/ieee802154/mac802154

[PATCH] lan743x: remove redundant intializations of pointers adapter and phydev

2021-03-28 Thread Colin King
From: Colin Ian King The pointers adapter and phydev are being initialized with values that are never read and are being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/net/ethern

[PATCH] mac80211: remove redundant assignment of variable result

2021-03-28 Thread Colin King
From: Colin Ian King The variable result is being assigned a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- net/mac80211/tx.c | 2 +- 1 file chan

[PATCH] rtlwifi: remove redundant assignment to variable err

2021-03-27 Thread Colin King
From: Colin Ian King Variable err is assigned -ENODEV followed by an error return path via label error_out that does not access the variable and returns with the -ENODEV error return code. The assignment to err is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by:

[PATCH][next] mlxsw: spectrum_router: remove redundant initialization of variable force

2021-03-27 Thread Colin King
From: Colin Ian King The variable force is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/net/ethernet/mellanox/

[PATCH] bpf: remove redundant assignment of variable id

2021-03-26 Thread Colin King
From: Colin Ian King The variable id is being assigned a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- kernel/bpf/btf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/bpf/btf.c b/kerne

[PATCH] drivers: net: smc91x: remove redundant initialization of pointer gpio

2021-03-26 Thread Colin King
From: Colin Ian King The pointer gpio is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/net/ethernet/smsc/smc91x

[PATCH][next] ethtool: fec: Fix bitwise-and with ETHTOOL_FEC_NONE

2021-03-26 Thread Colin King
From: Colin Ian King Currently ETHTOOL_FEC_NONE_BIT is being used as a mask, however this is zero and the mask should be using ETHTOOL_FEC_NONE instead. Fix this. Addresses-Coverity: ("Bitwise-and with zero") Fixes: 42ce127d9864 ("ethtool: fec: sanitize ethtool_fecparam->fec") Signed-off-by: Col

[PATCH][next] net: bridge: Fix missing return assignment from br_vlan_replay_one call

2021-03-24 Thread Colin King
From: Colin Ian King The call to br_vlan_replay_one is returning an error return value but this is not being assigned to err and the following check on err is currently always false because err was initialized to zero. Fix this by assigning err. Addresses-Coverity: ("'Constant' variable guards d

[PATCH] octeontx2-af: Fix memory leak of object buf

2021-03-23 Thread Colin King
From: Colin Ian King Currently the error return path when lfs fails to allocate is not free'ing the memory allocated to buf. Fix this by adding the missing kfree. Addresses-Coverity: ("Resource leak") Fixes: f7884097141b ("octeontx2-af: Formatting debugfs entry rsrc_alloc.") Signed-off-by: Colin

[PATCH][next] octeontx2-pf: Fix spelling mistake "ratelimitter" -> "ratelimiter"

2021-03-19 Thread Colin King
From: Colin Ian King There is a spelling mistake in an error message. Fix it. Signed-off-by: Colin Ian King --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c b/drive

[PATCH] brcmsmac: fix shift on 4 bit masked value

2021-03-18 Thread Colin King
From: Colin Ian King The calculation of offtune_val seems incorrect, the u16 value in pi->tx_rx_cal_radio_saveregs[2] is being masked with 0xf0 and then shifted 8 places right so that always ends up as a zero result. I believe the intended shift was 4 bits to the right. Fix this. [Note: not test

[PATCH][next] octeontx2-af: Remove redundant initialization of pointer pfvf

2021-03-18 Thread Colin King
From: Colin Ian King The pointer pfvf is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Fixes: 56bcef528bd8 ("octeontx2-af: Use npc_install_flow API for pr

[PATCH][next] ath11k: qmi: Fix spelling mistake "requeqst" -> "request"

2021-03-16 Thread Colin King
From: Colin Ian King There is a spelling mistake in an ath11k_warn message. Fix it. Signed-off-by: Colin Ian King --- drivers/net/wireless/ath/ath11k/qmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath1

[PATCH][next] net/mlx5: Fix spelling mistakes in mlx5_core_info message

2021-03-15 Thread Colin King
From: Colin Ian King There are two spelling mistakes in a mlx5_core_info message. Fix them. Signed-off-by: Colin Ian King --- drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b

[PATCH] mt76: mt7921: remove redundant check on type

2021-03-12 Thread Colin King
From: Colin Ian King Currently in the switch statement case where type is NL80211_IFTYPE_STATION there is a check to see if type is not NL80211_IFTYPE_STATION. This check is always false and is redundant dead code that can be removed. Addresses-Coverity: ("Logically dead code") Fixes: e0f9fdda8

[PATCH] scsi: target: vhost-scsi: remove redundant initialization of variable ret

2021-03-03 Thread Colin King
From: Colin Ian King The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/vhost/scsi.c | 2 +- 1

[PATCH] mt7601u: fix always true expression

2021-02-25 Thread Colin King
From: Colin Ian King Currently the expression ~nic_conf1 is always true because nic_conf1 is a u16 and according to 6.5.3.3 of the C standard the ~ operator promotes the u16 to an integer before flipping all the bits. Thus the top 16 bits of the integer result are all set so the expression is alw

[PATCH][next] mt76: mt7921: remove redundant check on variable type

2021-02-24 Thread Colin King
From: Colin Ian King In the switch statement case where type is NL80211_IFTYPE_STATION there is a check for type != NL80211_IFTYPE_STATION which is always false and hence it is redundant dead code and can be removed. Addresses-Coverity: ("Logically dead code") Fixes: e0f9fdda81bd ("mt76: mt7921:

[PATCH] i40e: Fix incorrect use of ip6src due to copy-paste coding error

2021-02-15 Thread Colin King
From: Colin Ian King It appears that the call of ipv6_add_any for the destination address is using ip6src instead of ip6dst, this looks like a copy-paste coding error. Fix this by replacing ip6src with ip6dst. Addresses-Coverity: ("Copy-paste error") Fixes: efca91e89b67 ("i40e: Add flow director

[PATCH][next] i40e: Fix uninitialized variable mfs_max

2021-02-15 Thread Colin King
From: Colin Ian King The variable mfs_max is not initialized and is being compared to find the maximum value. Fix this by initializing it to 0. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 90bc8e003be2 ("i40e: Add hardware configuration for software based DCB") Signed-off-by: Col

[PATCH] b43: N-PHY: Fix the update of coef for the PHY revision >= 3case

2021-02-15 Thread Colin King
From: Colin Ian King The documentation for the PHY update [1] states: Loop 4 times with index i If PHY Revision >= 3 Copy table[i] to coef[i] Otherwise Set coef[i] to 0 the copy of the table to coef is currently implemented the wrong way around, table is being updated f

[PATCH][next] octeontx2-af: Fix spelling mistake "recievd" -> "received"

2021-02-12 Thread Colin King
From: Colin Ian King There is a spelling mistake in the text in array rpm_rx_stats_fields, fix it. Signed-off-by: Colin Ian King --- drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx

[PATCH][next] ath11k: debugfs: Fix spelling mistake "Opportunies" -> "Opportunities"

2021-02-12 Thread Colin King
From: Colin Ian King There is a spelling mistake in some debug text, fix this. Signed-off-by: Colin Ian King --- drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c b/driver

[PATCH][next] net: hns3: Fix uninitialized return from function

2021-02-10 Thread Colin King
From: Colin Ian King Currently function hns3_reset_notify_uninit_enet is returning the contents of the uninitialized variable ret. Fix this by removing ret (since it is no longer used) and replace it with a return of the literal value 0. Addresses-Coverity: ("Uninitialized scalar variable") Fix

[PATCH] mac80211: fix potential overflow when multiplying to u32 integers

2021-02-05 Thread Colin King
From: Colin Ian King The multiplication of the u32 variables tx_time and estimated_retx is performed using a 32 bit multiplication and the result is stored in a u64 result. This has a potential u32 overflow issue, so avoid this by casting tx_time to a u64 to force a 64 bit multiply. Addresses-Co

[PATCH] net: dwc-xlgmac: Fix spelling mistake in function name

2021-02-04 Thread Colin King
From: Colin Ian King There is a spelling mistake in the function name alloc_channles_and_rings. Fix this by renaming it to alloc_channels_and_rings. Signed-off-by: Colin Ian King --- drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c | 2 +- drivers/net/ethernet/synopsys/dwc-xlgmac-net.c | 2 +-

[PATCH][next] net/mlx5e: Fix spelling mistake "channles" -> "channels"

2021-02-04 Thread Colin King
From: Colin Ian King There is a spelling mistake in a netdev_warn message. Fix it. Signed-off-by: Colin Ian King --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/driver

[PATCH][next] staging: qlge: fix read of an uninitialized pointer

2021-02-03 Thread Colin King
From: Colin Ian King Currently the pointer 'reporter' is not being initialized and is being read in a netdev_warn message. The pointer is not used and is redundant, fix this by removing it and replacing the reference to it with priv->reporter instead. Addresses-Coverity: ("Uninitialized pointer

[PATCH][next] net: hns3: remove redundant null check of an array

2021-02-03 Thread Colin King
From: Colin Ian King The null check of filp->f_path.dentry->d_iname is redundant because it is an array of DNAME_INLINE_LEN chars and cannot be a null. Fix this by removing the null check. Addresses-Coverity: ("Array compared against 0") Fixes: 04987ca1b9b6 ("net: hns3: add debugfs support for t

[PATCH][next] net/mlx5e: Fix spelling mistake "Unknouwn" -> "Unknown"

2021-02-03 Thread Colin King
From: Colin Ian King There is a spelling mistake in a netdev_warn message. Fix it. Signed-off-by: Colin Ian King --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/driver

[PATCH] netfilter: nf_tables: remove redundant assignment of variable err

2021-01-28 Thread Colin King
From: Colin Ian King The variable err is being assigned a value that is never read, the same error number is being returned at the error return path via label err1. Clean up the code by removing the assignment. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- net/netfilt

[PATCH] rtlwifi: rtl8192se: remove redundant initialization of variable rtstatus

2021-01-28 Thread Colin King
From: Colin Ian King The variable rtstatu is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/net/wireless/realte

[PATCH] iwlwifi: mvm: remove redundant initialization of variable phy_id

2021-01-28 Thread Colin King
From: Colin Ian King The variable phy_id is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/net/wireless/intel/i

[PATCH] libertas: remove redundant initialization of variable ret

2021-01-28 Thread Colin King
From: Colin Ian King The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/net/wireless/marvell/li

[PATCH][next] selftests: forwarding: Fix spelling mistake "succeded" -> "succeeded"

2021-01-18 Thread Colin King
From: Colin Ian King There are two spelling mistakes in check_fail messages. Fix them. Signed-off-by: Colin Ian King --- tools/testing/selftests/net/forwarding/tc_chains.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/tc_chains.

[PATCH] octeontx2-af: fix memory leak of lmac and lmac->name

2021-01-07 Thread Colin King
From: Colin Ian King Currently the error return paths don't kfree lmac and lmac->name leading to some memory leaks. Fix this by adding two error return paths that kfree these objects Addresses-Coverity: ("Resource leak") Fixes: 1463f382f58d ("octeontx2-af: Add support for CGX link management")

[PATCH][next] octeontx2-af: Fix undetected unmap PF error check

2020-12-16 Thread Colin King
From: Colin Ian King Currently the check for an unmap PF error is always going to be false because intr_val is a 32 bit int and is being bit-mask checked against 1ULL << 32. Fix this by making intr_val a u64 to match the type at it is copied from, namely npa_event_context->npa_af_rvu_ge. Addres

[PATCH] net: nixge: fix spelling mistake in Kconfig: "Instuments" -> "Instruments"

2020-12-16 Thread Colin King
From: Colin Ian King There is a spelling mistake in the Kconfig. Fix it. Signed-off-by: Colin Ian King --- drivers/net/ethernet/ni/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ni/Kconfig b/drivers/net/ethernet/ni/Kconfig index 01229190132d..d

[PATCH][V2] wilc1000: fix spelling mistake in Kconfig "devision" -> "division"

2020-12-16 Thread Colin King
From: Colin Ian King There is a spelling mistake in the Kconfig help text. Fix it. Signed-off-by: Colin Ian King --- V2: remove another fix from the patch --- drivers/net/wireless/microchip/wilc1000/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wirel

[PATCH] wilc1000: fix spelling mistake in Kconfig "devision" -> "division"

2020-12-16 Thread Colin King
From: Colin Ian King There is a spelling mistake in the Kconfig help text. Fix it. Signed-off-by: Colin Ian King --- drivers/net/ethernet/ni/Kconfig | 2 +- drivers/net/wireless/microchip/wilc1000/Kconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dr

[PATCH] net/mlx5: fix spelling mistake in Kconfig "accelaration" -> "acceleration"

2020-12-15 Thread Colin King
From: Colin Ian King There are some spelling mistakes in the Kconfig. Fix these. Signed-off-by: Colin Ian King --- drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/driver

[PATCH][next] net: hns3: fix expression that is currently always true

2020-12-14 Thread Colin King
From: Colin Ian King The || condition in hdev->fd_active_type != HCLGE_FD_ARFS_ACTIVE || hdev->fd_active_type != HCLGE_FD_RULE_NONE will always be true because hdev->fd_active_type cannot be equal to two different values at the same time. The expression is always true which is not correct. Fix t

[PATCH][next] netfilter: nftables: fix incorrect increment of loop counter

2020-12-14 Thread Colin King
From: Colin Ian King The intention of the err_expr cleanup path is to iterate over the allocated expr_array objects and free them, starting from i - 1 and working down to the start of the array. Currently the loop counter is being incremented instead of decremented and also the index i is being u

[PATCH][next] ath11k: add missing null check on allocated skb

2020-12-14 Thread Colin King
From: Colin Ian King Currently the null check on a newly allocated skb is missing and this can lead to a null pointer dereference is the allocation fails. Fix this by adding a null check and returning -ENOMEM. Addresses-Coverity: ("Dereference null return") Fixes: 43ed15e1ee01 ("ath11k: put hw t

[PATCH][next] selftests/bpf: fix spelling mistake "tranmission" -> "transmission"

2020-12-14 Thread Colin King
From: Colin Ian King There are two spelling mistakes in output messages. Fix these. Signed-off-by: Colin Ian King --- tools/testing/selftests/bpf/xdpxceiver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/xdpxceiver.c b/tools/testing/selft

[PATCH] net: sched: fix spelling mistake in Kconfig "trys" -> "tries"

2020-12-07 Thread Colin King
From: Colin Ian King There is a spelling mistake in the Kconfig help text. Fix it. Signed-off-by: Colin Ian King --- net/nfc/Kconfig | 2 +- net/sched/Kconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/nfc/Kconfig b/net/nfc/Kconfig index 9b27599870e3..96b91674

[PATCH][next] seg6: fix unintentional integer overflow on left shift

2020-12-07 Thread Colin King
From: Colin Ian King Shifting the integer value 1 is evaluated using 32-bit arithmetic and then used in an expression that expects a unsigned long value leads to a potential integer overflow. Fix this by using the BIT macro to perform the shift to avoid the overflow. Addresses-Coverity: ("Uninit

[PATCH] net: fix spelling mistake "wil" -> "will" in Kconfig

2020-12-04 Thread Colin King
From: Colin Ian King There is a spelling mistake in the Kconfig help text. Fix it. Signed-off-by: Colin Ian King --- drivers/net/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 4ee41924cdf1..260f9f46668b 100644 --- a/d

[PATCH] net: brcmfmac: remove redundant assignment to pointer 'entry'

2020-12-04 Thread Colin King
From: Colin Ian King The pointer 'entry' is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/net/wireless/broadco

[PATCH][next] rtw88: coex: fix missing unitialization of variable 'interval'

2020-12-03 Thread Colin King
From: Colin Ian King Currently the variable 'interval' is not initialized and is only set to 1 when oex_stat->bt_418_hid_existi is true. Fix this by inintializing variable interval to 0 (which I'm assuming is the intended default). Addresses-Coverity: ("Uninitalized scalar variable") Fixes: 5b2

[PATCH][next] wilc1000: remove redundant assignment to pointer vif

2020-12-03 Thread Colin King
From: Colin Ian King The assignment to pointer vif is redundant as the assigned value is never read, hence it can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/net/wireless/microchip/wilc1000/wlan.c | 1 - 1 file changed, 1 deletion(-) diff --git a

[PATCH][next] samples/bpf: Fix spelling mistake "recieving" -> "receiving"

2020-12-03 Thread Colin King
From: Colin Ian King There is a spelling mistake in an error message. Fix it. Signed-off-by: Colin Ian King --- samples/bpf/xdpsock_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_user.c index 0fee7f3aef3c..9553c7c47fc

[PATCH][next] net: hns3: fix spelling mistake "memroy" -> "memory"

2020-11-23 Thread Colin King
From: Colin Ian King There are spelling mistakes in two dev_err messages. Fix them. Signed-off-by: Colin Ian King --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletion

[PATCH][next] octeontx2-af: Fix access of iter->entry after iter object has been kfree'd

2020-11-18 Thread Colin King
From: Colin Ian King The call to pc_delete_flow can kfree the iter object, so the following dev_err message that accesses iter->entry can accessmemory that has just been kfree'd. Fix this by adding a temporary variable 'entry' that has a copy of iter->entry and also use this when indexing into t

[PATCH][next] octeontx2-af: Fix return of uninitialized variable err

2020-11-18 Thread Colin King
From: Colin Ian King Currently the variable err may be uninitialized if several of the if statements are not executed in function nix_tx_vtag_decfg and a garbage value in err is returned. Fix this by initialized ret at the start of the function. Addresses-Coverity: ("Uninitialized scalar variab

[PATCH][next] octeontx2-pf: Fix unintentional sign extension issue

2020-11-18 Thread Colin King
From: Colin Ian King The shifting of the u16 result from ntohs(proto) by 16 bits to the left will be promoted to a 32 bit signed int and then sign-extended to a u64. In the event that the top bit of the return from ntohs(proto) is set then all then all the upper 32 bits of a 64 bit long end up a

[PATCH] net: wireless: make a const array static, makes object smaller

2020-11-16 Thread Colin King
From: Colin Ian King Don't populate the const array bws on the stack but instead it static. Makes the object code smaller by 80 bytes: Before: textdata bss dec hex filename 85694 168651216 103775 1955f ./net/wireless/reg.o After: textdata bss dec

[PATCH][next] mptcp: fix a dereference of pointer before msk is null checked.

2020-11-09 Thread Colin King
From: Colin Ian King Currently the assignment of pointer net from the sock_net(sk) call is potentially dereferencing a null pointer sk. sk points to the same location as pointer msk and msk is being null checked after the sock_net call. Fix this by calling sock_net after the null check on pointe

[PATCH][next] net: dsa: fix unintended sign extension on a u16 left shift

2020-11-09 Thread Colin King
From: Colin Ian King The left shift of u16 variable high is promoted to the type int and then sign extended to a 64 bit u64 value. If the top bit of high is set then the upper 32 bits of the result end up being set by the sign extension. Fix this by explicitly casting the value in high to a u64

[PATCH][next] can: usb: fix potential integer overflow on shift of a int

2020-11-05 Thread Colin King
From: Colin Ian King The left shift of int 32 bit integer constant 1 is evaluated using 32 bit arithmetic and then assigned to a signed 64 bit variable. In the case where time_ref->adapter->ts_used_bits is 32 or more this can lead to an oveflow. Avoid this by shifting using the BIT_ULL macro inst

[PATCH] octeontx2-pf: Fix sizeof() mismatch

2020-11-02 Thread Colin King
From: Colin Ian King An incorrect sizeof() is being used, sizeof(u64 *) is not correct, it should be sizeof(*sq->sqb_ptrs). Fixes: caa2da34fd25 ("octeontx2-pf: Initialize and config queues") Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)") Signed-off-by: Colin Ian King --- drivers

[PATCH] net: dev_ioctl: remove redundant initialization of variable err

2020-11-02 Thread Colin King
From: Colin Ian King The variable err is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- net/core/dev_ioctl.c | 2 +- 1

[PATCH][next] nl80211/cfg80211: fix potential infinite loop

2020-10-29 Thread Colin King
From: Colin Ian King The for-loop iterates with a u8 loop counter and compares this with the loop upper limit of request->n_ssids which is an int type. There is a potential infinite loop if n_ssids is larger than the u8 loop counter, so fix this by making the loop counter an int. Addresses-Cover

[PATCH][next] net/sunrpc: fix unsigned size_t comparison to less than zero

2020-10-28 Thread Colin King
From: Colin Ian King Currently the check for *lenp < 0 is always true since the type is a size_t and can never be negative. Fix this by casting it to ssize_t. Addresses-Coverity: ("Unsigned compared against 0") Fixes: c09f56b8f68d ("net/sunrpc: Fix return value for sysctl sunrpc.transports") Si

[PATCH] net: atm: fix update of position index in lec_seq_next

2020-10-27 Thread Colin King
From: Colin Ian King The position index in leq_seq_next is not updated when the next entry is fetched an no more entries are available. This causes seq_file to report the following error: "seq_file: buggy .next function lec_seq_next [lec] did not update position index" Fix this by always updat

[PATCH 0/2] vsock: minor clean up of ioctl error handling

2020-10-27 Thread Colin King
From: Colin Ian King Two minor changes to the ioctl error handling. Colin Ian King (2): vsock: remove ratelimit unknown ioctl message vsock: fix the error return when an invalid ioctl command is used net/vmw_vsock/af_vsock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.27

[PATCH 2/2] vsock: fix the error return when an invalid ioctl command is used

2020-10-27 Thread Colin King
From: Colin Ian King Currently when an invalid ioctl command is used the error return is -EINVAL. Fix this by returning the correct error -ENOIOCTLCMD. Signed-off-by: Colin Ian King --- net/vmw_vsock/af_vsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vmw_vsock/

[PATCH 1/2][V2] vsock: remove ratelimit unknown ioctl message

2020-10-27 Thread Colin King
From: Colin Ian King When exercising the kernel with stress-ng with some ioctl tests the "Unknown ioctl" error message is spamming the kernel log at a high rate. Remove this message. Signed-off-by: Colin Ian King --- net/vmw_vsock/af_vsock.c | 1 - 1 file changed, 1 deletion(-) diff --git a/n

[PATCH] vsock: ratelimit unknown ioctl error message

2020-10-23 Thread Colin King
From: Colin Ian King When exercising the kernel with stress-ng with some ioctl tests the "Unknown ioctl" error message is spamming the kernel log at a high rate. Rate limit this message to reduce the noise. Signed-off-by: Colin Ian King --- net/vmw_vsock/af_vsock.c | 2 +- 1 file changed, 1 in

[PATCH] net: dsa: bcm_sf2: make const array static, makes object smaller

2020-10-20 Thread Colin King
From: Colin Ian King Don't populate the const array rate_table on the stack but instead it static. Makes the object code smaller by 46 bytes. Before: textdata bss dec hex filename 298123824 192 338288424 drivers/net/dsa/bcm_sf2.o After: textdata bss

[PATCH] can: isotp: make const array static, makes object smaller

2020-10-20 Thread Colin King
From: Colin Ian King Don't populate the const array plen on the stack but instead it static. Makes the object code smaller by 926 bytes. Before: textdata bss dec hex filename 265311943 64 285386f7a net/can/isotp.o After: textdata bss dec he

[PATCH][next] net/mlx5: Fix uininitialized pointer read on pointer attr

2020-10-06 Thread Colin King
From: Colin Ian King Currently the error exit path err_free kfree's attr. In the case where flow and parse_attr failed to be allocated this return path will free the uninitialized pointer attr, which is not correct. In the other case where attr fails to allocate attr does not need to be freed. S

[PATCH][next] ath11k: fix memory leak of 'combinations'

2020-10-06 Thread Colin King
From: Colin Ian King Currently the error return path when 'limits' fails to allocate does not free the memory allocated for 'combinations'. Fix this by adding a kfree before returning. Addresses-Coverity: ("Resource leak") Fixes: 2626c269702e ("ath11k: add interface_modes to hw_params") Signed-o

[PATCH][next] net: phy: dp83869: fix unsigned comparisons against less than zero values

2020-10-02 Thread Colin King
From: Colin Ian King Currently the comparisons of u16 integers value and sopass_val with less than zero for error checking is always false because the values are unsigned. Fix this by making these variables int. This does not affect the shift and mask operations performed on these variables Add

[PATCH][next] net/mlx5: fix dereference on pointer flow before null check

2020-09-28 Thread Colin King
From: Colin Ian King Currently pointer flow is being dereferenced before it is being null checked. Fix this by adding a null check for flow and parse_attr earlier. Also change the err_free path to explicitly return -ENOMEM and remove the need for the err return variable. Addresses-Coverity: ("D

[PATCH] qtnfmac: fix resource leaks on unsupported iftype error return path

2020-09-25 Thread Colin King
From: Colin Ian King Currently if an unsupported iftype is detected the error return path does not free the cmd_skb leading to a resource leak. Fix this by free'ing cmd_skb. Addresses-Coverity: ("Resource leak") Fixes: 805b28c05c8e ("qtnfmac: prepare for AP_VLAN interface type support") Signed-o

[PATCH] rhashtable: fix indentation of a continue statement

2020-09-18 Thread Colin King
From: Colin Ian King A continue statement is indented incorrectly, add in the missing tab. Signed-off-by: Colin Ian King --- lib/test_rhashtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c index c5a6fef7b45d..76c607ee6db5

[PATCH] ipv6: remove redundant assignment to variable err

2020-09-11 Thread Colin King
From: Colin Ian King The variable err is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Also re-order variable declarations in reverse Christmas tree ordering. Addresses-Coverity: ("Unused val

[PATCH][next] xsk: fix incorrect memory allocation failure check on dma_map->dma_pages

2020-09-02 Thread Colin King
From: Colin Ian King The failed memory allocation check for dma_map->dma_pages is incorrect, it is null checking dma_map and not dma_map->dma_pages. Fix this. Addresses-Coverity: ("Logicall dead code") Fixes: 921b68692abb ("xsk: Enable sharing of dma mappings") Signed-off-by: Colin Ian King ---

  1   2   3   4   5   6   7   >