re: fsdax: output address in dax_iomap_pfn() and rename it

2022-06-06 Thread Colin King (gmail)
Hi, Static analysis with clang scan-build found a potential issue with the following commit in linux-next today: commit 1447ac26a96463a05ad9f5cfba7eef43d52913ef Author: Shiyang Ruan Date: Fri Jun 3 13:37:32 2022 +0800 fsdax: output address in dax_iomap_pfn() and rename it The

[PATCH][next] selftests: add missing void in MREMAP_DONTUNMAP selftest function prototypes

2021-04-20 Thread Colin King
From: Colin Ian King There are a few function prototypes that are missing a void parameter, fix this by adding it in. Signed-off-by: Colin Ian King --- tools/testing/selftests/vm/mremap_dontunmap.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git

[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

[PATCH] perf/x86: Fix integer overflow when left shifting an integer more than 32 bits

2021-04-20 Thread Colin King
From: Colin Ian King The 64 bit value read from MSR_ARCH_PERFMON_FIXED_CTR_CTRL is being bit-wise masked with the value (0x03 << i*4). However, the shifted value is evaluated using 32 bit arithmetic, so will overflow when i > 8. Fix this by making 0x03 a ULL so that the shift is performed using

[PATCH] ALSA: usb: midi: don't return -ENOMEM when usb_urb_ep_type_check fails

2021-04-20 Thread Colin King
From: Colin Ian King Currently when the call to usb_urb_ep_type_check fails (returning -EINVAL) the error return path returns -ENOMEM via the exit label "error". Other uses of the same error exit label set the err variable to -ENOMEM but this is not being used. I believe the original intent was

[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 ---

[PATCH][next] platform/x86: intel_pmc_core: fix unsigned variable compared to less than zero

2021-04-20 Thread Colin King
From: Colin Ian King The check for ret < 0 is always false because ret is a (unsigned) size_t and not a (signed) ssize_t, hence simple_write_to_buffer failures are never detected. Fix this by making ret a ssize_t Addresses-Coverity: ("Unsigned compared against 0") Fixes: 8074a79fad2e

[PATCH] usb: storage: datafab: remove redundant assignment of variable result

2021-04-20 Thread Colin King
From: Colin Ian King The variable result is being assigned with a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/usb/storage/datafab.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH] usb: gadget: net2272: remove redundant initialization of status

2021-04-20 Thread Colin King
From: Colin Ian King The variable status 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 and move the declaration of status to the scope where it is used. Addresses-Coverity: ("Unused

[PATCH] tty: synclink_gt: remove redundant initialization of variable count

2021-04-20 Thread Colin King
From: Colin Ian King The variable count 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/tty/synclink_gt.c |

[PATCH] scsi: megaraid_mbox: remove redundant initialization of pointer mbox

2021-04-20 Thread Colin King
From: Colin Ian King The pointer mbox 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 ---

[PATCH] scsi: lpfc: remove redundant assignment to pointer temp_hdr

2021-04-20 Thread Colin King
From: Colin Ian King The pointer tmp_hdr 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 --- drivers/scsi/lpfc/lpfc_sli.c | 1 - 1 file changed, 1 deletion(-) diff --git

[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

[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

[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")

[PATCH][next] bcache: Set error return err to -ENOMEM on allocation failure

2021-04-19 Thread Colin King
From: Colin Ian King Currently when ns fails to be allocated the error return path returns an uninitialized return code in variable 'err'. Fix this by setting err to -ENOMEM. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 688330711e9a ("bcache: initialize the nvm pages allocator")

[PATCH] iommu: remove redundant assignment to variable agaw

2021-04-16 Thread Colin King
From: Colin Ian King The variable agaw is initialized with a value that is never read and it is being updated later with a new value as a counter in a for-loop. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH] PM / wakeup: remove redundant assignment to variable retval

2021-04-16 Thread Colin King
From: Colin Ian King The variable retval 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 ---

[PATCH] drm/amdgpu/pm: use linux/processor.h instead of asm/processor.h

2021-04-16 Thread Colin King
From: Colin Ian King Checkpatch reported that linux/processor.h should be included instead of the asm variant. Fix this to clean up the warning. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[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

[PATCH] scsi: 3w-9xxx: Move * operator to clean up code style warning

2021-04-16 Thread Colin King
From: Colin Ian King Checkpatch is warning that char* text sould be char *text to match the coding style. Fix this. Signed-off-by: Colin Ian King --- drivers/scsi/3w-9xxx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/3w-9xxx.h b/drivers/scsi/3w-9xxx.h

[PATCH] sched/core: Add in additional const on preempt_modes array declaration

2021-04-16 Thread Colin King
From: Colin Ian King Checkpatch warnings that there is a missing const, fix this by adding it. Clean us up warning: "WARNING: static const char * array should probably be static const char * const" Signed-off-by: Colin Ian King --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH] um: Fix inline void order in function declaration

2021-04-15 Thread Colin King
From: Colin Ian King The inline keyword should be between storage class and type. Fix this by swapping void inline to inline void. Signed-off-by: Colin Ian King --- arch/x86/um/shared/sysdep/stub_32.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] ACPI: APEI: remove redundant assignment to variable rc

2021-04-15 Thread Colin King
From: Colin Ian King The variable rc 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 --- drivers/acpi/apei/einj.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH] partitions/ldm: remove redundant assignment to variable r_index

2021-04-15 Thread Colin King
From: Colin Ian King The variable r_index 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 --- block/partitions/ldm.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH] floppy: remove redundant assignment to variable st

2021-04-15 Thread Colin King
From: Colin Ian King The variable st 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 --- arch/x86/include/asm/floppy.h | 1 - 1

[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] dmaengine: idxd: Fix potential null dereference on pointer status

2021-04-15 Thread Colin King
From: Colin Ian King There are calls to idxd_cmd_exec that pass a null status pointer however a recent commit has added an assignment to *status that can end up with a null pointer dereference. The function expects a null status pointer sometimes as there is a later assignment to *status where

[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

[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:

[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

[PATCH][next] vdpa/mlx5: Fix resource leak of mgtdev due to incorrect kfree

2021-04-12 Thread Colin King
From: Colin Ian King Static analysis is reporting a memory leak on mgtdev, it appears that the wrong object is being kfree'd. Fix this by kfree'ing mgtdev rather than mdev. Addresses-Coverity: ("Resource leak") Fixes: c8a2d4c73e70 ("vdpa/mlx5: Enable user to add/delete vdpa device")

[PATCH][next] habanalabs/gaudi: Fix uninitialized return code rc when read size is zero

2021-04-12 Thread Colin King
From: Colin Ian King In the case where size is zero the while loop never assigns rc and the return value is uninitialized. Fix this by initializing rc to zero. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 639781dcab82 ("habanalabs/gaudi: add debugfs to DMA from the device")

[PATCH][next] KEYS: trusted: Fix missing null return from kzalloc call

2021-04-12 Thread Colin King
From: Colin Ian King The kzalloc call can return null with the GFP_KERNEL flag so add a null check and exit via a new error exit label. Use the same exit error label for another error path too. Addresses-Coverity: ("Dereference null return value") Fixes: 830027e2cb55 ("KEYS: trusted: Add

[PATCH][next] Bluetooth: virtio_bt: add missing null pointer check on alloc_skb call return

2021-04-09 Thread Colin King
From: Colin Ian King The call to alloc_skb with the GFP_KERNEL flag can return a null sk_buff pointer, so add a null check to avoid any null pointer deference issues. Addresses-Coverity: ("Dereference null return value") Fixes: afd2daa26c7a ("Bluetooth: Add support for virtio transport driver")

[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

[PATCH] xfs: fix return of uninitialized value in variable error

2021-04-09 Thread Colin King
From: Colin Ian King A previous commit removed a call to xfs_attr3_leaf_read that assigned an error return code to variable error. We now have a few early error return paths to label 'out' that return error if error is set; however error now is uninitialized so potentially garbage is being

[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

[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

[PATCH] media: s2255drv: remove redundant assignment to variable field

2021-04-09 Thread Colin King
From: Colin Ian King The variable 'field' is being assigned a value this is never read, it is being updated in all the following if/else combinations. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][V2] clk: uniphier: Fix potential infinite loop

2021-04-09 Thread Colin King
From: Colin Ian King The for-loop iterates with a u8 loop counter i and compares this with the loop upper limit of num_parents that is an int type. There is a potential infinite loop if num_parents is larger than the u8 loop counter. Fix this by making the loop counter the same type as

[PATCH][V2] clk: uniphier: Fix potential infinite loop

2021-04-09 Thread Colin King
From: Colin Ian King The for-loop iterates with a u8 loop counter i and compares this with the loop upper limit of num_parents that is an int type. There is a potential infinite loop if num_parents is larger than the u8 loop counter. Fix this by making the loop counter the same type as

[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

[PATCH] clk: uniphier: Fix potential infinite loop

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

[PATCH] staging: rtl8192u: Fix potential infinite loop

2021-04-07 Thread Colin King
From: Colin Ian King The for-loop iterates with a u8 loop counter i and compares this with the loop upper limit of riv->ieee80211->LinkDetectInfo.SlotNum that is a u16 type. There is a potential infinite loop if SlotNum is larger than the u8 loop counter. Fix this by making the loop counter the

[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

[PATCH][next] media: venus: hfi,pm,firmware: Fix dereference before null check on hdev

2021-04-07 Thread Colin King
From: Colin Ian King The pointer hdev is being dereferenced twice on the assignment of pointers cpu_cs_base and wrapper_base before hdev is being null checked. Fix the potential null pointer dereference issues by performing the null check of hdev before dereferencing it when assigning

[PATCH][next] scsi: pm80xx: Fix potential infinite loop

2021-04-07 Thread Colin King
From: Colin Ian King The for-loop iterates with a u8 loop counter i and compares this with the loop upper limit of pm8001_ha->max_q_num which is a u32 type. There is a potential infinite loop if pm8001_ha->max_q_num is larger than the u8 loop counter. Fix this by making the loop counter the

[PATCH][next] media: venus: core,pm: fix potential infinite loop

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

[PATCH] staging: comedi: drivers: Fix spelling mistake "nubmer" -> "number"

2021-04-07 Thread Colin King
From: Colin Ian King There is a spelling mistake in a comment. Fix it. Signed-off-by: Colin Ian King --- drivers/staging/comedi/drivers/addi_apci_16xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_16xx.c

[PATCH][next] nvmet: Fix spelling mistake "nubmer" -> "number"

2021-04-07 Thread Colin King
From: Colin Ian King There is a spelling mistake in a pr_err error message. Fix it. Signed-off-by: Colin Ian King --- drivers/nvme/target/configfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c index

[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

[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

[PATCH] hwmon: (dme1737): Add missing null check on return from platform_get_resource

2021-04-06 Thread Colin King
From: Colin Ian King The call to platform_get_resource can potentially return a NULL pointer on failure, so add this check and return -EINVAL if it fails. Addresses-Coverity: ("Dereference null return") Fixes: e95c237d78c0 ("hwmon: (dme1737) Add sch311x support") Signed-off-by: Colin Ian King

[PATCH] usb: gadget: r8a66597: Add missing null check on return from platform_get_resource

2021-04-06 Thread Colin King
From: Colin Ian King The call to platform_get_resource can potentially return a NULL pointer on failure, so add this check and return -EINVAL if it fails. Addresses-Coverity: ("Dereference null return") Fixes: c41442474a26 ("usb: gadget: R8A66597 peripheral controller support.") Signed-off-by:

[PATCH][next] clk: socfpga: remove redundant initialization of variable div

2021-04-06 Thread Colin King
From: Colin Ian King The variable div 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 ---

[PATCH] clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return

2021-04-06 Thread Colin King
From: Colin Ian King There is an error return path that is not kfree'ing socfpga_clk leading to a memory leak. Fix this by adding in the missing kfree call. Addresses-Coverity: ("Resource leak") Signed-off-by: Colin Ian King --- drivers/clk/socfpga/clk-gate-a10.c | 1 + 1 file changed, 1

[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:

[PATCH][next] regmap-irq: Fix dereference of a potentially null d->virt_buf

2021-04-06 Thread Colin King
From: Colin Ian King The clean up of struct d can potentiallly index into a null array d->virt_buf causing errorenous pointer dereferencing issues on kfree calls. Fix this by adding a null check on d->virt_buf before attempting to traverse the array to kfree the objects. Addresses-Coverity:

[PATCH][next] erofs: fix uninitialized variable i used in a while-loop

2021-04-06 Thread Colin King
From: Colin Ian King The while-loop iterates until src is non-null or i is 3, however, the loop counter i is not intinitialied to zero, causing incorrect iteration counts. Fix this by initializing it to zero. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 1aa5f2e2feed ("erofs:

[PATCH][next] drm/msm: Fix spelling mistake "Purgable" -> "Purgeable"

2021-04-06 Thread Colin King
From: Colin Ian King There is a spelling mistake in debugfs gem stats. Fix it. Also re-align output to cater for the extra 1 character. Signed-off-by: Colin Ian King --- drivers/gpu/drm/msm/msm_gem.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH][next] drm/i915: Fix an uninitialized variable issue

2021-04-01 Thread Colin King
From: Colin Ian King Currently there is a while loop that contains a handful of continue statements that can skip over the assignment of the variable err. At the end of the loop there is a potiential for err to be unassigned and possibly causing issues when err is checked for a non-zero value.

[PATCH][next] crypto: sun8i-ss: Fix memory leak of pad

2021-04-01 Thread Colin King
From: Colin Ian King It appears there are several failure return paths that don't seem to be free'ing pad. Fix these. Addresses-Coverity: ("Resource leak") Fixes: d9b45418a917 ("crypto: sun8i-ss - support hash algorithms") Signed-off-by: Colin Ian King ---

[PATCH] crypto: sa2ul: Fix memory lead of rxd

2021-04-01 Thread Colin King
From: Colin Ian King There are two error return paths that are not freeing rxd and causing memory leaks. Fix these. Addresses-Coverity: ("Resource leak") Fixes: 00c9211f60db ("crypto: sa2ul - Fix DMA mapping API usage") Signed-off-by: Colin Ian King --- drivers/crypto/sa2ul.c | 8 ++-- 1

[PATCH][V2] crypto: sa2ul: Fix memory leak of rxd

2021-04-01 Thread Colin King
From: Colin Ian King There are two error return paths that are not freeing rxd and causing memory leaks. Fix these. Addresses-Coverity: ("Resource leak") Fixes: 00c9211f60db ("crypto: sa2ul - Fix DMA mapping API usage") Signed-off-by: Colin Ian King --- V2: Fix typo in $SUBJECT ---

[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

[PATCH][next] soundwire: qcom: Fix a u8 comparison with less than zero

2021-03-31 Thread Colin King
From: Colin Ian King Variable devnum is being checked for a less than zero error return however the comparison will always be false because devnum is an 8 bit unsigned integer. Fix this by making devnum an int. Also there is no need to iniitialize devnum with zero as this value is no read, so

[PATCH][next] drm/amd/display: remove redundant initialization of variable status

2021-03-31 Thread Colin King
From: Colin Ian King The variable status 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 clean up an indentation. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King ---

[PATCH][next] ASoC: mediatek: mt6359: Fix spelling mistake "reate" -> "create"

2021-03-30 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dev_err error message. Fix it. Signed-off-by: Colin Ian King --- sound/soc/codecs/mt6359-accdet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/mt6359-accdet.c b/sound/soc/codecs/mt6359-accdet.c index

[PATCH][next] mm/vmalloc: Fix read of pointer area after it has been free'd

2021-03-29 Thread Colin King
From: Colin Ian King Currently the memory pointed to by area is being freed by the free_vm_area call and then area->nr_pages is referencing the free'd object. Fix this swapping the order of the warn_alloc message and the free. Addresses-Coverity: ("Read from pointer after free") Fixes:

[PATCH] i915: Fix uninitialized variable err

2021-03-29 Thread Colin King
From: Colin Ian King In the case where !sg_dma_len(sgl) breaks out of the do-while loop on the first iteration, error variable err has not been assigned any value and will contain garbage. Fix this by ensuring err is initialized to zero. Addresses-Coverity: ("Uninitialized scalar variable")

[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 ---

[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 ---

[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

[PATCH] USB: serial: iuu_phoenix: remove redundant variable 'error'

2021-03-27 Thread Colin King
From: Colin Ian King The variable error is initialized to 0 and is set to 1 this value is never read as it is on an immediate return path. The only read of error is to check it is 0 and this check is always true at that point of the code. The variable is redundant and can be removed.

[PATCH] scsi: qedi: emove redundant assignment to variable err

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

[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] mfd: timberdale: 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 err_mfd that does not access the variable and returns with the -ENODEV error return code. The assignment to err is redundant and can be removed. Signed-off-by: Colin Ian King ---

[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 ---

[PATCH] io_uring: remove unsued assignment to pointer io

2021-03-26 Thread Colin King
From: Colin Ian King There is an assignment to io that is never read after the assignment, the assignment is redundant and can be removed. Signed-off-by: Colin Ian King --- fs/io_uring.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index

[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

[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 ---

[PATCH] platform/x86: panasonic-laptop: remove redundant assignment of variable result

2021-03-26 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 assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/platform/x86/panasonic-laptop.c

[PATCH] usb: cdnsp: remove redundant initialization of variable ret

2021-03-26 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/usb/cdns3/cdnsp-mem.c

[PATCH] PCI: endpoint: remove redundant initialization of pointer dev

2021-03-26 Thread Colin King
From: Colin Ian King The pointer dev 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 ---

[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:

[PATCH] mtd: cfi: remove redundant assignment to variable timeo

2021-03-25 Thread Colin King
From: Colin Ian King The variable timeo 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 ---

[PATCH][next] cifsd: remove redundant assignment to variable err

2021-03-25 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 --- fs/cifsd/vfs.c | 2 +- 1 file

[PATCH][next] thermal/drivers/devfreq_cooling: Fix error return if kasprintf returns NULL

2021-03-25 Thread Colin King
From: Colin Ian King Currently when kasprintf fails and returns NULL, the error return -ENOMEM is being assigned to cdev instead of err causing the return via the label remove_qos_re to return the incorrect error code. Fix this by explicitly setting err before taking the error return path.

[PATCH][next] scsi: a100u2w: remove unused variable biosaddr

2021-03-25 Thread Colin King
From: Colin Ian King The variable biosaddr is being assigned a value that is never read, the variable is redundant and can be safely removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/scsi/a100u2w.c | 3 --- 1 file changed, 3 deletions(-) diff --git

[PATCH][next] staging: rtl8188eu: Fix null pointer dereference on free_netdev call

2021-03-24 Thread Colin King
From: Colin Ian King An unregister_netdev call checks if pnetdev is null, hence a later call to free_netdev can potentially be passing a null pointer, causing a null pointer dereference. Avoid this by adding a null pointer check on pnetdev before calling free_netdev. Fixes: 1665c8fdffbb

[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

[PATCH][next] media: imx-jpeg: Pass the v4l2_jpeg_header header argument by reference

2021-03-23 Thread Colin King
From: Colin Ian King Currently the header argument is being passed by value, so a copy of 256 byte structure on the stack is potentially occurring. Fix this by passing by reference to avoid any large stack copies. Addresses-Coverity: ("Big parameter passed by value") Fixes: 2db16c6ed72c

[PATCH][next] drm/amd/display/dc/calcs/dce_calcs: Fix allocation size for dceip and vbios

2021-03-23 Thread Colin King
From: Colin Ian King Currently the allocations for dceip and vbios are based on the size of the pointer rather than the size of the data structures, causing heap issues. Fix this by using the correct allocation sizes. Addresses-Coverity: ("Wrong size of argument") Fixes: a2a855772210

[PATCH][next] media: dvb-frontends: Remove redundant error check on variable ret

2021-03-23 Thread Colin King
From: Colin Ian King An earlier commit removed a call to lgdt3306a_spectral_inversion and omitted to remove the error return check. The check on ret is now redundant and can be removed. Addresses-Coverity: ("Logically dead code") Fixes: d4a3fa6652e3 ("media: dvb-frontends: lgdt3306a.c: remove

[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:

[PATCH][next] media: imx-jpeg: Fix spelling mistake "Canot" -> "Cannot"

2021-03-23 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King --- drivers/media/platform/imx-jpeg/mxc-jpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/imx-jpeg/mxc-jpeg.c

[PATCH][next] iommu: Fix spelling mistake "sixe" -> "size"

2021-03-19 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King --- drivers/iommu/sprd-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c index

[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

  1   2   3   4   5   6   7   8   9   10   >