[PATCH][next] bnxt_en: ensure len is ininitialized to zero

2018-01-12 Thread Colin King
From: Colin Ian King In the case where cmp_type == CMP_TYPE_RX_L2_TPA_START_CMP the exit return path is via label next_rx_no_prod and cpr->rx_bytes is being updated by an uninitialized value from len. Fix this by initializing len to zero. Detected by CoverityScan, CID#1463807 ("Uninitialized sca

[PATCH] esp4: remove redundant initialization of pointer esph

2018-01-30 Thread Colin King
From: Colin Ian King Pointer esph is being assigned a value that is never read, esph is re-assigned and only read inside an if statement, hence the initialization is redundant and can be removed. Cleans up clang warning: net/ipv4/esp4.c:657:21: warning: Value stored to 'esph' during its initiali

[PATCH] ocxl: fix signed comparison with less than zero

2018-01-30 Thread Colin King
From: Colin Ian King Currently the comparison of used < 0 is always false because uses is a size_t. Fix this by making used a ssize_t type. Detected by Coccinelle: drivers/misc/ocxl/file.c:320:6-10: WARNING: Unsigned expression compared with zero: used < 0 Fixes: 5ef3166e8a32 ("ocxl: Driver cod

[PATCH] NFC: fdp: fix signed less or equal zero check in u8 max_size

2018-01-30 Thread Colin King
From: Colin Ian King The u8 variable max_size is being assigned a return value from the call to nci_conn_max_data_pkt_payload_size that can return a -ve error return. Since max_size is a u8, the -ve check for the error will always be false. Fix this by making max_size an int type. Detected using

[PATCH] clocksource/drivers/fsl_ftm_timer: fix unsigned < 0 comparison check

2018-01-30 Thread Colin King
From: Colin Ian King The return from the call __ftm_clk_init can be negative if there is an error, and this is being checked, however, the check is always false because freq is unsigned. Fix this by removing the unsigned type qualifier, making freq just a long. Detected using Coccinelle: driver

[PATCH] libnvdimm, namespace: remove redundant initialization of 'nd_mapping'

2018-01-30 Thread Colin King
From: Colin Ian King Pointer nd_mapping is being initialized to a value that is never read, instead it is being updated to a new value in all the cases where it is being read afterwards, hence the initialization is redundant and can be removed. Cleans up clang warning: drivers/nvdimm/namespace_d

[PATCH] wireless: zd1211rw: remove redundant assignment of pointer 'q'

2018-01-30 Thread Colin King
From: Colin Ian King Pointer q is initialized and then almost immediately afterwards being re-assigned the same value. Remove the second redundant assignment. Cleans up clang warning: drivers/net/wireless/zydas/zd1211rw/zd_mac.c:503:23: warning: Value stored to 'q' during its initialization is n

[PATCH][next] wil6210: fix spelling mistake: "preperation"-> "preparation"

2018-01-30 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in debug error message text. Signed-off-by: Colin Ian King --- drivers/net/wireless/ath/wil6210/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wi

[PATCH] x86/cpu/bugs: fix spelling mistake: "vunerable"-> "vulnerable"

2018-01-30 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in pr_err error message text. Signed-off-by: Colin Ian King --- arch/x86/kernel/cpu/bugs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 3bfb2b23d79c..fa1aaf

[PATCH] be2net: remove redundant initialization of 'head' and pointer txq

2018-01-31 Thread Colin King
From: Colin Ian King Variable head is initialized to a value that is never read and is being updated to a new value a few lines later, hence this initialization is redundant and can be safely removed as well as the now unused pointer txq. Cleans up clang warning: drivers/net/ethernet/emulex/bene

[PATCH] media: cx25821: prevent out-of-bounds read on array card

2018-01-31 Thread Colin King
From: Colin Ian King Currently an out of range dev->nr is detected by just reporting the issue and later on an out-of-bounds read on array card occurs because of this. Fix this by checking the upper range of dev->nr with the size of array card (removes the hard coded size), move this check earlie

[PATCH] net: jme: remove unused initialization of 'rxdesc'

2018-02-01 Thread Colin King
From: Colin Ian King Pointer rxdesc is assigned a value that is never read, it is overwritten by a new assignment inside a while loop hence the initial assignment is redundant and can be removed. Cleans up clang warning: drivers/net/ethernet/jme.c:1074:17: warning: Value stored to 'rxdesc' durin

[PATCH] lan78xx: remove redundant initialization of pointer 'phydev'

2018-02-01 Thread Colin King
From: Colin Ian King Pointer phydev is initialized and this value is never read, phydev is immediately updated to a new value, hence this initialization is redundant and can be removed Cleans up clang warning: drivers/net/usb/lan78xx.c:2009:21: warning: Value stored to 'phydev' during its initia

[PATCH] vmxnet3: remove redundant initialization of pointer 'rq'

2018-02-01 Thread Colin King
From: Colin Ian King Pointer rq is being initialized but this value is never read, it is being updated inside a for-loop. Remove the initialization and move it into the scope of the for-loop. Cleans up clang warning: drivers/net/vmxnet3/vmxnet3_drv.c:2763:27: warning: Value stored to 'rq' during

[PATCH] ath5k: remove duplicated re-assignment to pointer 'tq'

2018-02-01 Thread Colin King
From: Colin Ian King Pointer tq is initialized with &ah->ah_txq[queue] and then a few lines later is re-assigned the same value, hence this duplicate assignment is redundant and can be removed. Cleans up clang warning: drivers/net/wireless/ath/ath5k/qcu.c:326:25: warning: Value stored to 'tq' du

[PATCH] ixgbevf: remove redundant initialization of variable 'dma'.

2018-02-01 Thread Colin King
From: Colin Ian King Variable dma is initialized with a value that is never read, later on it is re-assigned a new value, hence the initialization is redundant and can be removed. Cleans up clang warning: drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:584:13: warning: Value stored to 'dma' du

[PATCH][V2] mtd: nand: marvell: fix spelling mistake: "suceed"-> "succeed"

2018-01-18 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistakes in dev_err error message text. Signed-off-by: Colin Ian King --- drivers/mtd/nand/marvell_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/marvell_nand.c b/drivers/mtd/nand/marvell_nand.c index b8f

[PATCH][V2] mtd: nand: marvell: remove redundant variable 'oob_len'

2018-01-19 Thread Colin King
From: Colin Ian King Variable oob_len is assigned and never read, hence it is redundant and can be removed. Cleans up clang warnings: drivers/mtd/nand/marvell_nand.c:1356:6: warning: Value stored to 'oob_len' during its initialization is never read drivers/mtd/nand/marvell_nand.c:1369:4: warnin

[PATCH] mtd: block2mtd: remove redundant initialization of 'bdev'

2018-01-20 Thread Colin King
From: Colin Ian King Pointer bdev is being initialized however this value is never read as bdev is assigned an updated value from the returned call to blkdev_get_by_path. Remove the redundant assignment. Cleans up clang warning: drivers/mtd/devices/block2mtd.c:228:23: warning: Value stored to '

[PATCH] staging: rtl8192e: remove two redundant assignments

2018-01-20 Thread Colin King
From: Colin Ian King Clang detected two redundant assignments that can be safely removed. The first is the removal of the duplicated assignment to pointer 'hdr', this has already been initialized with the same value. The second is the removal of the redundant initialization of variable 'timeout'

[PATCH] staging: rtl8712: remove redundant initialization to 'rfPath'

2018-01-20 Thread Colin King
From: Colin Ian King The value stored to rfPath during initialization is never read, the following switch statement re-assigns it a new value on all the case and default paths. Hence the initialization is redundant and can be removed. Cleans up clang warning: drivers/staging/rtl8712/rtl871x_mp.c

[PATCH][next] NTB: ntb_tool: fix memory leak on 'buf' on error exit path

2018-01-22 Thread Colin King
From: Colin Ian King Currently there is a memory leak on buf when the call to ntb_mw_get_align fails. Add an exit err label and jump to this so that kfree on buf frees the memory. Detected by CoverityScan, CID#1464286 ("Resource leak") Fixes: d637628ce00c ("NTB: ntb_tool: Add full multi-port N

[PATCH][next] devlink: fix memory leak on 'resource'

2018-01-22 Thread Colin King
From: Colin Ian King Currently, if the call to devlink_resource_find returns null then the error exit path does not free the devlink_resource 'resource' and a memory leak occurs. Fix this by kfree'ing resource on the error exit path. Detected by CoverityScan, CID#1464184 ("Resource leak") Fixes

[PATCH] net: caif: remove redundant re-assignment of pointer pfrm

2018-01-22 Thread Colin King
From: Colin Ian King The pointer pfrm is initialized and then later re-assigned the same value and hence the second assignment is redundant and can be removed. Cleans up clang warning: drivers/net/caif/caif_hsi.c:222:6: warning: Value stored to 'pfrm' during its initialization is never read Sig

[PATCH] staging: rtl8192u: remove redundant initialization of 'timeout'

2018-01-22 Thread Colin King
From: Colin Ian King Variable timeout is initialized however this value is never read and it is reassigned a new value a little later, hence the initialization is redundant and can be removed. Cleans up clang warning: drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1728:6: warning: Value

[PATCH][scsi-next] scsi: aacraid: remove redundant setting of variable c

2018-01-05 Thread Colin King
From: Colin Ian King A previous commit no longer stores the contents of c, so we now have a situation where c is being updated but the value is never read. Clean up the code by removing the now redundant setting of variable c. Cleans up clang warning: drivers/scsi/aacraid/aachba.c:943:3: warning

[PATCH][scsi-next] scsi: qla2xxx: remove redundant assignment of d

2018-01-05 Thread Colin King
From: Colin Ian King The initialization of d is redundant as this value is never read and it is overwritten inside the subsequent for-loop. Remove this redundant assignment. Cleans up clang warning: drivers/scsi/qla2xxx/qla_gs.c:3985:29: warning: Value stored to 'd' during its initialization is

[PATCH][next] HID: asus: make array 'buf' static const, shrinks object size

2018-01-06 Thread Colin King
From: Colin Ian King Don't populate the const read-only array 'buf' on the stack but instead make it stati. Makes the object code smaller by 26 bytes: Before: textdata bss dec hex filename 143782384 64 1682641ba linux/drivers/hid/hid-asus.o After: text

[PATCH] [media] exynos4-is: make array 'cmd' static, shrinks object size

2018-01-06 Thread Colin King
From: Colin Ian King Don't populate the const read-only array 'cmd' on the stack but instead make it static. Makes the object code smaller by 38 bytes: Before: textdata bss dec hex filename 4950 868 0581816ba fimc-is-regs.o After: textdata bss

[PATCH] Bluetooth: bpa10x: make array 'req' static, shrinks object size

2018-01-06 Thread Colin King
From: Colin Ian King Don't populate the const read-only array 'req' on the stack but instead make it static. Makes the object code smaller by over 40 bytes: Before: textdata bss dec hex filename 84973408 128 120332f01 linux/drivers/bluetooth/bpa10x.o After:

[PATCH] Bluetooth: btintel: make array 'param' static, shrinks object size

2018-01-06 Thread Colin King
From: Colin Ian King Don't populate the const read-only array 'param' on the stack but instead make it static. Makes the object code smaller by nearly 20 bytes: Before: textdata bss dec hex filename 116052629 64 1429837da linux/drivers/bluetooth/btintel.o Aft

[PATCH] gpu: ipu-v3: make array 'int_reg' static, shrinks object size

2018-01-06 Thread Colin King
From: Colin Ian King Don't populate the const read-only array 'int_reg' on the stack but instead make it static. Makes the object code smaller by over 80 bytes: Before: textdata bss dec hex filename 280248936 192 371529120 drivers/gpu/ipu-v3/ipu-common.o After

[PATCH] ixgbevf: use ARRAY_SIZE for various array sizing calculations

2018-01-07 Thread Colin King
From: Colin Ian King Use the ARRAY_SIZE macro on various arrays to determine size of the arrays. Improvement suggested by coccinelle. Signed-off-by: Colin Ian King --- drivers/net/ethernet/intel/ixgbevf/vf.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a

[PATCH] scsi: bfa: use ARRAY_SIZE for array sizing calculation on array __pciids

2018-01-07 Thread Colin King
From: Colin Ian King Use the ARRAY_SIZE macro on array __pciids to determine size of the array. Improvement suggested by coccinelle. Signed-off-by: Colin Ian King --- drivers/scsi/bfa/bfa_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/bfa/bfa_core.c b/d

[PATCH] ixgbe: use ARRAY_SIZE for array sizing calculation on array buf

2018-01-07 Thread Colin King
From: Colin Ian King Use the ARRAY_SIZE macro on array buf to determine size of the array. Improvement suggested by coccinelle. Signed-off-by: Colin Ian King --- drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethern

[PATCH] be2net: use ARRAY_SIZE for array sizing calculation on array cmd_priv_map

2018-01-07 Thread Colin King
From: Colin Ian King Use the ARRAY_SIZE macro on array cmd_priv_map to determine size of the array. Improvement suggested by coccinelle. Signed-off-by: Colin Ian King --- drivers/net/ethernet/emulex/benet/be_cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ne

[PATCH] ipv6: use ARRAY_SIZE for array sizing calculation on array seg6_action_table

2018-01-07 Thread Colin King
From: Colin Ian King Use the ARRAY_SIZE macro on array seg6_action_table to determine size of the array. Improvement suggested by coccinelle. Signed-off-by: Colin Ian King --- net/ipv6/seg6_local.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/seg6_local.c b/net/

[PATCH] perf tools: fix spelling mistake: "successfull"-> "successful"

2018-01-26 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistakes in pr_debug message text. Signed-off-by: Colin Ian King --- tools/perf/util/bpf-loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index 72c107fcbc5a..806

[PATCH] staging: rtl8723bs: remove a couple of redundant initializations

2018-01-26 Thread Colin King
From: Colin Ian King The initialization of PwrCfgCmd is redundant as the value is never read and it is being re-assigned to PwrSeqCmd[AryIdx] inside a loop, hence it can be removed. Also, the initialization of ie_ptr is redundant as the value is never read and it is being re-assigned in either p

[PATCH] staging: rtlwifi: remove redundant initialization of 'cfg_cmd'

2018-01-26 Thread Colin King
From: Colin Ian King The initialization of cfg_cmd is redundant as the value is never read and it is being re-assigned to cfg_cmd = pwrcfgcmd[ary_idx] inside a loop, hence it can be removed. Cleans up clang warning: drivers/staging/rtlwifi/core.c:1819:22: warning: Value stored to 'cfg_cmd' durin

[PATCH] media: staging: atomisp: remove redundant assignments to various variables

2018-01-26 Thread Colin King
From: Colin Ian King There are various assignments that are being made to variables that are not read and the variables are being updated later on, hence the redundant assignments can be removed. Cleans up clang warnings: drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:1950:8: warning:

[PATCH] USB: wusbcore: remove redundant re-assignment to pointer 'dev'

2018-01-26 Thread Colin King
From: Colin Ian King Pointer dev is initialized and then re-assigned with the same value a little later, hence the second assignment is redundant and can be removed. Cleans up clang warning: drivers/usb/wusbcore/wa-nep.c:88:17: warning: Value stored to 'dev' during its initialization is never re

[PATCH] USB: gadget: function: remove redundant initialization of 'tv_nexus'

2018-01-26 Thread Colin King
From: Colin Ian King Pointer tv_nexus is being initialized a value and this is never read and is later being updated with the same value. Remove the redundant initialization so that the assignment to tv_nexus is performed later and more local to when it is being read. Cleans up clang warning: dr

[PATCH] orangefs: replace vmalloc and memset with vzalloc

2018-01-26 Thread Colin King
From: Colin Ian King Use vzalloc instead of the vmalloc, memset combo Signed-off-by: Colin Ian King --- fs/orangefs/devorangefs-req.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c index f073cd9e6687..a50fb896

[PATCH] HID: logitech-hidpp: remove duplicated assignment to 'hidpp'

2018-01-16 Thread Colin King
From: Colin Ian King Pointer hidpp is being assigned twice with the same value, remove the second occurrance as it is redundant. Cleans up clang warning: drivers/hid/hid-logitech-hidpp.c:177:23: warning: Value stored to 'hidpp' during its initialization is never read Signed-off-by: Colin Ian Ki

[PATCH] i2c-stm32f4: remove redundant initialization of pointer reg

2018-01-16 Thread Colin King
From: Colin Ian King The pointer reg is assigned a value that is never read, it is later overwritten with a new value, hence the redundant initialization can be removed. Cleans up clang warning: drivers/i2c/busses/i2c-stm32f4.c:352:16: warning: Value stored to 'reg' during its initialization is

[PATCH] ide: remove duplicated assignment to 'cursg'

2018-01-16 Thread Colin King
From: Colin Ian King Pointer cursg is initialized to cmd->cursg and again re-assigned the same value a few lines later, hence the second assignment is redundant and can be removed. Cleans up clang warning: drivers/ide/ide-taskfile.c:229:22: warning: Value stored to 'cursg' during its initializat

[PATCH] scsi: mptsas: remove duplicated assignment to pointer head

2018-01-16 Thread Colin King
From: Colin Ian King The pointer head is re-assigned the same value twice, so remove the second redundant assignment. Cleans up clang warning: drivers/message/fusion/mptsas.c:1161:20: warning: Value stored to 'head' during its initialization is never read Signed-off-by: Colin Ian King --- dri

[PATCH] cifs: remove redundant duplicated assignment of pointer 'node'

2018-01-17 Thread Colin King
From: Colin Ian King Node is assigned twice to rb_first(root), first during declaration time and second after a taking a spin lock, so we have a duplicated assignment. Remove the first assignment because it is redundant and also not protected by the spin lock. Cleans up clang warning: fs/cifs/c

[PATCH] ASoC: Intel: remove second duplicated assignment to pointer 'res'

2018-01-17 Thread Colin King
From: Colin Ian King The second assignment to res is identical to the previous assignment so it is redundant and can be removed. Cleans up clang warning: sound/soc/intel/skylake/skl-topology.c:191:25: warning: Value stored to 'res' during its initialization is never read Signed-off-by: Colin Ia

[PATCH] input: cyapa: remove redundant assignment to 'pwr_cmd'

2018-01-17 Thread Colin King
From: Colin Ian King The variable pwr_cmd is being assigned to cyapa->suspend_power_mode twice, once during the declaration and once after taking an interruptible mutex lock. Remove the redundant first assignment since the value is never read and it is outside the mutex lock. Cleans up clang wa

[PATCH][next] mlxsw: spectrum: make function mlxsw_sp_kvdl_part_occ static

2018-01-17 Thread Colin King
From: Colin Ian King The function mlxsw_sp_kvdl_part_occ is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'mlxsw_sp_kvdl_part_occ' was not declared. Should it be static? Signed-off-by: Colin Ian King --- drivers/net/ethernet/

[PATCH][next] staging: fsl-mc: make function its_fsl_mc_msi_init static

2018-01-17 Thread Colin King
From: Colin Ian King The function its_fsl_mc_msi_init is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'its_fsl_mc_msi_init' was not declared. Should it be static? Signed-off-by: Colin Ian King --- drivers/staging/fsl-mc/bus/i

[PATCH][devlink-next] devlink: make functions a couple of new functions static

2018-01-17 Thread Colin King
From: Colin Ian King The functions devlink_resource_find and devlink_resource_validate_children are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'devlink_resource_find' was not declared. Should it be static? warning: symbol 'de

[PATCH] USB: serial: remove redundant initializations of 'mos_parport'

2018-01-17 Thread Colin King
From: Colin Ian King The pointer mos_parport is being initialized to pp->private_data and then the assignment is duplicated after a spin lock. Remove the initialization as it occurs before the spin lock and it is a redundant assignment. Cleans up clang warnings: drivers/usb/serial/mos7720.c:521

[PATCH] mmc: sh_mmcif: remove redundant initialization of 'opc'

2018-01-17 Thread Colin King
From: Colin Ian King Variable opc is initialized with a value that is never read, opc is later re-assigned a newer value, hence the initialization can be removed. Cleans up clang warning: drivers/mmc/host/sh_mmcif.c:919:6: warning: Value stored to 'opc' during its initialization is never read S

[PATCH][btrfs-next] Btrfs: extent map selftest: add missing void parameter to btrfs_test_extent_map

2018-01-08 Thread Colin King
From: Colin Ian King Add a missing void parameter to function btrfs_test_extent_map, fixes sparse warning: warning: non-ANSI function declaration of function 'btrfs_test_extent_map' Signed-off-by: Colin Ian King --- fs/btrfs/tests/extent-map-tests.c | 2 +- 1 file changed, 1 insertion(+), 1 d

[PATCH][next] ASoC: TSCS42xx: make functions pll_event and dac_event static

2018-01-08 Thread Colin King
From: Colin Ian King The functions pll_event and dac_event are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'pll_event' was not declared. Should it be static? symbol 'dac_event' was not declared. Should it be static? Signed-of

[PATCH][next] IB/mlx5: remove redundant assignment of mdev

2018-01-09 Thread Colin King
From: Colin Ian King The initial assignment to mdev is redundant as mdev is re-assigned later and the first assigned value is never read. Remove this redundant assignment. Cleans up clang warning: drivers/infiniband/hw/mlx5/main.c:359:24: warning: Value stored to 'mdev' during its initialization

[PATCH][next] rtlwifi: btcoexist: remove redundant variable fw_ps_state

2018-01-09 Thread Colin King
From: Colin Ian King Variable fw_ps_state is assigned a value but it is never read, hence it is redundant and can be removed. Cleans up clang warning: drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c:736:2: warning: Value stored to 'fw_ps_state' is never read Signed-off-by: Colin I

[PATCH][staging-next] ncpfs: remove redundant cast of struct ncp_inode_info

2018-01-09 Thread Colin King
From: Colin Ian King Casting a value returned by memory an allocation function is not required and can be removed. Also add in a newline after before the first statement. Code clean up as suggested by coccinelle. Signed-off-by: Colin Ian King --- drivers/staging/ncpfs/inode.c | 3 ++- 1 file c

[PATCH][bpf-next] bpf: fix spelling mistake: "obusing" -> "abusing"

2018-01-10 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in error message text. Signed-off-by: Colin Ian King --- kernel/bpf/verifier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 97bbef3eecdf..e388f30c4168 100644 --- a/ke

[PATCH] bnxt_en: don't update cpr->rx_bytes with uninitialized length len

2018-01-16 Thread Colin King
From: Colin Ian King Currently in the cases where cmp_type == CMP_TYPE_RX_L2_TPA_START_CMP or CMP_TYPE_RX_L2_TPA_END_CMP the exit path updates cpr->rx_bytes with an uninitialized length len. Fix this by adding a new exit path that does not update the cpr stats with the bogus length len and remov

[PATCH][next] mtd: nand: fix spelling mistake: "suceed"-> "succeed"

2018-01-16 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistakes in dev_err error message text. Signed-off-by: Colin Ian King --- drivers/mtd/nand/marvell_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/marvell_nand.c b/drivers/mtd/nand/marvell_nand.c index b8f

[PATCH][next] gpiolib: remove redundant initialization of pointer desc

2018-01-16 Thread Colin King
From: Colin Ian King The initialized value stored in pointer desc is never read as it is updated in the first executable statement in the function. This is therefore redundant and can be removed. Cleans up clang warning: drivers/gpio/gpiolib.c:3710:20: warning: Value stored to 'desc' during its

[PATCH] ixgbe: remove redundant initialization of 'pool'

2018-01-16 Thread Colin King
From: Colin Ian King Variable pool is being assigned zero and then in the following for-loop is it being set to zero again. Remove the redundant first assignment. Cleans up clang warning: drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c:61:2: warning: Value stored to 'pool' is never read Signed-off

[PATCH][rds-next] rds: remove redundant variable 'sg_off'

2018-03-11 Thread Colin King
From: Colin Ian King Variable sg_off is assigned a value but it is never read, hence it is redundant and can be removed. Cleans up clang warning: net/rds/message.c:373:2: warning: Value stored to 'sg_off' is never read Signed-off-by: Colin Ian King --- net/rds/message.c | 2 -- 1 file changed

[PATCH][next] lan743x: remove some redundant variables and assignments

2018-03-11 Thread Colin King
From: Colin Ian King Function lan743x_phy_init assigns pointer 'netdev' but this is never read and hence it can be removed. The return error code handling can also be cleaned up to remove the variable 'ret'. Function lan743x_phy_link_status_change assigns pointer 'phy' twice and this is never re

[PATCH][next] lan743x: make functions lan743x_csr_read and lan743x_csr_read static

2018-03-11 Thread Colin King
From: Colin Ian King Functions lan743x_csr_read and lan743x_csr_read are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warning: drivers/net/ethernet/microchip/lan743x_main.c:56:5: warning: symbol lan743x_csr_read' was not declared. Should it be

[PATCH][rds-next] rds: make functions rds_info_from_znotifier and rds_message_zcopy_from_user static

2018-03-11 Thread Colin King
From: Colin Ian King Functions rds_info_from_znotifier and rds_message_zcopy_from_user are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnins: net/rds/message.c:70:27: warning: symbol 'rds_info_from_znotifier' was not declared. Should it be s

[PATCH][drm-next] drm/i915/gvt: fix spelling mistake: "destoried" -> "destroyed"

2018-03-12 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in gvt_err error message text. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gvt/gtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c index 0a100a2

[PATCH] echoaudio: remove redundant initialization of pointer 'pipe'

2018-03-12 Thread Colin King
From: Colin Ian King The pointer 'pipe' is being initialized with a value that is never read and it is re-assigned later, hence the initialization is redundant and can be removed. Also remove pointer 'runtime' as it is no longer required. Cleans up clang warning: sound/pci/echoaudio/echoaudio.c:

[PATCH] rxrpc: remove redundant initialization of variable 'len'

2018-03-12 Thread Colin King
From: Colin Ian King The variable 'len' is being initialized with a value that is never read and it is re-assigned later, hence the initialization is redundant and can be removed. Cleans up clang warning: net/rxrpc/recvmsg.c:275:15: warning: Value stored to 'len' during its initialization is nev

[PATCH] staging: comedi: adl_pci6208: remove redundant initialization of 'val'

2018-03-12 Thread Colin King
From: Colin Ian King Variable 'val' is initialized with a value that is never read, it is updated with a new value again after intitialization. Remove the redundant initialization and move the declaration and assignment into the scope of the for-loop. Cleans up clang warning: drivers/staging/com

[PATCH][net-next] net: mvpp2: make function mvpp2_check_hw_buf_num static

2018-03-06 Thread Colin King
From: Colin Ian King The function mvpp2_check_hw_buf_num is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: drivers/net/ethernet/marvell/mvpp2.c:4298:5: warning: symbol 'mvpp2_check_hw_buf_num' was not declared. Should it be static? Sign

[PATCH][next][V2] staging: r8822be: fix typos in header guard macros

2018-03-23 Thread Colin King
From: Colin Ian King The macros for __PHYDMKFREE_H__ and __PHYDM_FEATURES_H__ contain typos and don't match the #if guard check. Defined them correctly. Cleans up clang warnings: warning: '__PHYDMKFREE_H__' is used as a header guard here, followed by #define of a different macro [-Wheader-guard]

[PATCH][next] batman-adv: don't pass a NULL hard_iface to batadv_hardif_put

2018-03-23 Thread Colin King
From: Colin Ian King In the case where hard_iface is NULL, the error path may pass a null pointer to batadv_hardif_put causing a null pointer dereference error. Avoid this by only calling the function if hard_iface not null. Detected by CoverityScan, CID#1466456 ("Explicit null dereferenced")

[PATCH][next] apparmor: fix error returns checks by making size a ssize_t

2018-03-23 Thread Colin King
From: Colin Ian King Currently variable size is a unsigned size_t, hence comparisons to see if it is less than zero (for error checking) will always be false. Fix this by making size a ssize_t Detected by CoverityScan, CID#1466080 ("Unsigned compared against 0") Fixes: 8e51f9087f40 ("apparmor:

[PATCH] net: qualcomm: rmnet: check for null ep to avoid null pointer dereference

2018-03-23 Thread Colin King
From: Colin Ian King The call to rmnet_get_endpoint can potentially return NULL so check for this to avoid any subsequent null pointer dereferences on a NULL ep. Detected by CoverityScan, CID#1465385 ("Dereference null return value") Fixes: 23790ef12082 ("net: qualcomm: rmnet: Allow to configur

[PATCH][V3] staging: r8822be: fix typos in header guard macros

2018-03-25 Thread Colin King
From: Colin Ian King The macros for __PHYDMKFREE_H__ and __PHYDM_FEATURES_H__ contain typos and don't match the #if guard check. Defined them correctly. Cleans up clang warnings: warning: '__PHYDMKFREE_H__' is used as a header guard here, followed by #define of a different macro [-Wheader-guard]

[PATCH] net/ncsi: check for null return from call to nla_nest_start

2018-03-26 Thread Colin King
From: Colin Ian King The call to nla_nest_start calls nla_put which can lead to a NULL return so it's possible for attr to become NULL and we can potentially get a NULL pointer dereference on attr. Fix this by checking for a NULL return. Detected by CoverityScan, CID#1466125 ("Dereference null

[PATCH][next] drm/amd/pp: fix logical or'ing of garbage in result by initializing result to zero

2018-03-26 Thread Colin King
From: Colin Ian King Currently result is not initialized, so it contains a garbage value and this is or'd with data from vega10_program_didt_config_registers() which can end up with a non-zero value when the result should be zero. Fix this by ensuring result is initialized to zero. Detected by

[PATCH] RDMA/hns: ensure for-loop actually iterates and free's buffers

2018-03-26 Thread Colin King
From: Colin Ian King The current for-loop zeros variable i and only loops once, hence not all the buffers are free'd. Fix this by setting i correctly. Detected by CoverityScan, CID#1463415 ("Operands don't affect result") Fixes: a5073d6054f7 ("RDMA/hns: Add eq support of hip08") Signed-off-by:

[PATCH] staging: wilc1000: replace kmalloc + memcpy with kmemdup

2018-03-26 Thread Colin King
From: Colin Ian King Replace several allocation and memcpys with kmemdup and add in some missing memory allocation failure checks. Also fix an incorrect -EFAULT return with -ENOMEM. Signed-off-by: Colin Ian King --- drivers/staging/wilc1000/host_interface.c | 75 +++--

[PATCH][next] drm/amd/pp: Fix spelling mistake: "suppported" -> "supported"

2018-03-27 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in pr_warn warning message text Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c b/drivers/gpu/dr

[PATCH][next] libata: ensure host is free'd on error exit paths

2018-03-27 Thread Colin King
From: Colin Ian King The host structure is not being kfree'd on two error exit paths leading to memory leaks. Add in new err_free label and kfree host. Detected by CoverityScan, CID#1466103 ("Resource leak") Fixes: 2623c7a5f279 ("libata: add refcounting to ata_host") Signed-off-by: Colin Ian Ki

[PATCH][next] apparmor: fix memory leak on buffer on error exit path

2018-03-27 Thread Colin King
From: Colin Ian King Currently on the error exit path the allocated buffer is not free'd causing a memory leak. Fix this by kfree'ing it. Detected by CoverityScan, CID#1466876 ("Resource leaks") Fixes: 1180b4c757aa ("apparmor: fix dangling symlinks to policy rawdata after replacement") Signed-

[PATCH][next] ixgbevf: ensure xdp_ring resources are free'd on error exit

2018-03-27 Thread Colin King
From: Colin Ian King The current error handling for failed resource setup for xdp_ring data is a break out of the loop and returning 0 indicated everying was OK, when in fact it is not. Fix this by exiting via the error exit label err_setup_tx that will clean up the resources correctly and retur

[PATCH] ALSA: usb-audio: fix memory leak on cval

2018-03-27 Thread Colin King
From: Colin Ian King With the current exit return path of the ctl_info allocation failure cval is not being freed resulting in a memory leak. Fix this by kfree'ing it on the return. Detected by CoverityScan, CID#1466878 ("Resource Leak") Fixes: 21e9b3e931f7 ("ALSA: usb-audio: fix uac control qu

[PATCH][next] xfs: fix zero'ing of ILOG owner bits by using correct bitwise operator

2018-03-27 Thread Colin King
From: Colin Ian King Currently the masking of the ili_fields is using the ! operator which results in masking with 0, which clears all the bits which is not intended. Instead, use the ~ operator that negates the inverts the bits to correctly mask out the XFS_ILOG_AOWNER and XFS_ILOG_DOWNER bits.

[PATCH] tpm: st33zp24: check if chip is null before dereferencing

2018-04-06 Thread Colin King
From: Colin Ian King Currently chip is being dereferenced by the call to dev_get_drvdata before it is being null checked, hence we have a potential null pointer dereference bug. Fix this by only dereferencing it after the null check. Detected by CoverityScan, CID#1357806 ("Dereference before nul

[PATCH] tpm: st33zp24: remove redundant null check on chip

2018-04-06 Thread Colin King
From: Colin Ian King Currently chip is being dereferenced by the call to dev_get_drvdata before it is being null checked, however, chip can never be null, so this check is misleading and redundant. Remove it. Detected by CoverityScan, CID#1357806 ("Dereference before null check") Signed-off-by:

[PATCH][next] crypto: chtls: remove redundant assignment to cdev->ports

2018-04-06 Thread Colin King
From: Colin Ian King There is a double assignment to cdev->ports, the first is redundant as it is over-written so remove it. Detected by CoverityScan, CID#1467432 ("Unused value") Signed-off-by: Colin Ian King --- drivers/crypto/chelsio/chtls/chtls_main.c | 1 - 1 file changed, 1 deletion(-)

[PATCH][next] scsi: fnic: fix spelling mistake in fnic stats "Abord" -> "Abort"

2018-04-11 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in fnic stats message text Signed-off-by: Colin Ian King --- drivers/scsi/fnic/fnic_trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/fnic/fnic_trace.c b/drivers/scsi/fnic/fnic_trace.c index abddde11982

[PATCH][next] iwlwifi: mvm: remove division by size of sizeof(struct ieee80211_wmm_rule)

2018-04-11 Thread Colin King
From: Colin Ian King The subtraction of two struct ieee80211_wmm_rule pointers leaves a result that is automatically scaled down by the size of the size of pointed-to type, hence the division by sizeof(struct ieee80211_wmm_rule) is bogus and should be removed. Detected by CoverityScan, CID#14677

[PATCH][next] afs: fix integer overflow when shifting 1 more than 32 places

2018-04-11 Thread Colin King
From: Colin Ian King Shifting 1 (a 32 bit signed int) more than 32 places will overflow the int, so explicitly use 1ULL to avoid this overflow. Detected by CoverityScan, CID#1467808 ("Uninitentional integer overflow") Fixes: 63a4681ff39c ("afs: Locally edit directory data for mkdir/create/unli

[PATCH][next] staging: ks7010: fix null pointer dereference on priv on error exit

2018-04-12 Thread Colin King
From: Colin Ian King In the case where the call to dev_alloc_name fails the current exit path is via err_free_netdev and this calls free_netdev on a null priv pointer, hence causing a null pointer dereference. Fix this by instead exiting via err_release_irq. Detected by CoverityScan, CID#146784

[PATCH][next] dmaengine: dw-axi-dmac: fix spelling mistake: "catched" -> "caught"

2018-03-21 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in dev_err error message text Signed-off-by: Colin Ian King --- drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/

[PATCH][next] net: mvpp2: use correct index on array mvpp2_pools

2018-03-21 Thread Colin King
From: Colin Ian King Array mvpp2_pools is being indexed by long_log_pool, however this looks like a cut-n-paste bug and in fact should be short_log_pool. Detected by CoverityScan, CID#1466113 ("Copy-paste error") Fixes: 576193f2d579 ("net: mvpp2: jumbo frames support") Signed-off-by: Colin Ian

[PATCH][next] phy: qcom-qusb2: fix missing assignment to an error return code

2018-03-21 Thread Colin King
From: Colin Ian King The error return code is not being assigned to ret from the call to clk_prepare_enable and consequently the current check on ret picks up the previous error return. Fix this by adding in the missing assignment to ret. Detected by CoverityScan, CID#166020 ("Logically Dead cod

<    1   2   3   4   5   6   7   8   9   10   >