[PATCH] video: fbdev: replace spurious snprintf() with sprintf()

2020-08-24 Thread Alex Dewar
par->vgapass is a u8, so if we are assuming that buf is at least PAGE_SIZE then the extra checking is pointless. Signed-off-by: Alex Dewar --- drivers/video/fbdev/sstfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/sstfb.c b/drivers/video/fb

[PATCH] drm/amd/pm: use kmemdup() rather than kmalloc+memcpy

2020-08-24 Thread Alex Dewar
Issue identified with Coccinelle. Signed-off-by: Alex Dewar --- .../drm/amd/pm/powerplay/hwmgr/vega20_processpptables.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_processpptables.c b/drivers/gpu/drm/amd/pm

[PATCH] fs: omfs: use kmemdup() rather than kmalloc+memcpy

2020-08-24 Thread Alex Dewar
Issue identified with Coccinelle. Signed-off-by: Alex Dewar --- fs/omfs/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index b76ec6b88ded..8867cefa79cf 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c @@ -363,12 +363,11

[PATCH] ima: use kmemdup() rather than kmalloc+memcpy

2020-08-24 Thread Alex Dewar
Issue identified with Coccinelle. Signed-off-by: Alex Dewar --- security/integrity/ima/ima_policy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index b4de33074b37..ea917a787d9d 100644 --- a

Re: [PATCH] scsi: qla2xxx: Remove unnecessary call to memset

2020-08-24 Thread Alex Dewar
On 2020-08-20 19:51, Alex Dewar wrote: In qla25xx_set_els_cmds_supported(), a call is made to dma_alloc_coherent() followed by zeroing the memory with memset. This is unnecessary as dma_alloc_coherent() already zeros memory. Remove. Issue identified with Coccinelle. Signed-off-by: Alex Dewar

Re: [PATCH v2] scsi: Don't call memset after dma_alloc_coherent()

2020-08-24 Thread Alex Dewar
On 2020-08-21 00:49, Alex Dewar wrote: dma_alloc_coherent() already zeroes memory, so the extra call to memset() is unnecessary. Issue identified with Coccinelle. Signed-off-by: Alex Dewar Gentle ping? I've just realised that this is the one we want, not the v1 I just replied to. -

[PATCH] kernel/cpu.c: don't use snprintf() for sysfs attrs

2020-08-24 Thread Alex Dewar
As per the documentation (Documentation/filesystems/sysfs.rst), snprintf() should not be used for formatting values returned by sysfs. In these two instances, we know that the string will be --- kernel/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/cpu.c b/k

[PATCH] usb: atm: don't use snprintf() for sysfs attrs

2020-08-24 Thread Alex Dewar
ZE in length. Issue identified by Coccinelle. Signed-off-by: Alex Dewar --- drivers/usb/atm/cxacru.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index ea66f8f385bae..e62a770a5d3bf 100644

[PATCH] serial: core: don't use snprintf() for formatting sysfs attrs

2020-08-24 Thread Alex Dewar
As per the documentation (Documentation/filesystems/sysfs.rst), snprintf() should not be used for formatting values returned by sysfs. For all of the instances in serial_core.c, we know that the string will be --- drivers/tty/serial/serial_core.c | 26 +- 1 file changed,

Re: [PATCH] staging: emxx_udc: Fix passing of NULL to dma_alloc_coherent()

2020-08-25 Thread Alex Dewar
On Tue, Aug 25, 2020 at 10:37:13AM +0300, Dan Carpenter wrote: > On Mon, Aug 24, 2020 at 04:57:12PM +0100, Alex Dewar wrote: > > On Mon, Aug 24, 2020 at 04:19:17PM +0100, Alex Dewar wrote: > > > In nbu2ss_eq_queue() memory is allocated with dma_alloc_coherent(), > > >

Re: [PATCH] usb: atm: don't use snprintf() for sysfs attrs

2020-08-25 Thread Alex Dewar
On Tue, Aug 25, 2020 at 08:12:05AM +, David Laight wrote: > From: Alex Dewar > > Sent: 24 August 2020 23:23 > > kernel/cpu.c: don't use snprintf() for sysfs attrs > > > > As per the documentation (Documentation/filesystems/sysfs.rst), > > snprintf() sh

[PATCH v2] staging: emxx_udc: Fix passing of NULL to dma_alloc_coherent()

2020-08-25 Thread Alex Dewar
ot;staging: emxx_udc: Add Emma Mobile USB Gadget driver") Reported-by: Dan Carpenter Signed-off-by: Alex Dewar --- v2: also fix call to dma_free_coherent() (Dan) @Magnus: I noticed you contributed this code back in 2014... I don't suppose you happen to have the hardware lying around to test

Re: [PATCH RFC 0/2] simple sysfs wrappers for single values

2020-09-02 Thread Alex Dewar
On Sat, Aug 29, 2020 at 06:23:13PM -0700, Joe Perches wrote: > On Sat, 2020-08-29 at 17:28 -0700, Joe Perches wrote: > > On Sun, 2020-08-30 at 00:37 +0100, Alex Dewar wrote: > > > Hi all, > > > > > > I've noticed there seems to have been a fair amount

Re: [PATCH RFC 2/2] sysfs: add helper macro for showing simple integer values

2020-09-02 Thread Alex Dewar
On Sun, Aug 30, 2020 at 11:13:53AM +0200, Greg Kroah-Hartman wrote: > On Sun, Aug 30, 2020 at 12:37:17AM +0100, Alex Dewar wrote: > > sysfs attributes are supposed to be only single values, which are > > printed into a buffer of PAGE_SIZE. Accordingly, for many simple > > attr

[PATCH] staging/emxx_udc: Remove pointless variable assignments

2020-09-02 Thread Alex Dewar
In a number of places in emxx_udc.c, there are variables which are assigned to without that value ever being used. Remove these pointless assignments. Reported-by: kernel test robot Fixes: 33aa8d45a4fe ("staging: emxx_udc: Add Emma Mobile USB Gadget driver") Signed-off-by:

Re: [PATCH v2] scsi: Don't call memset after dma_alloc_coherent()

2020-09-02 Thread Alex Dewar
On Tue, Sep 01, 2020 at 09:22:44PM -0400, Martin K. Petersen wrote: > > Alex, > > > dma_alloc_coherent() already zeroes memory, so the extra call to > > memset() is unnecessary. > > One patch per driver, please. There's a single patch for QLA2XXX already submitted: https://lore.kernel.org/lkml

Re: [PATCH v2] scsi: Don't call memset after dma_alloc_coherent()

2020-09-02 Thread Alex Dewar
On Tue, Sep 01, 2020 at 09:22:44PM -0400, Martin K. Petersen wrote: > > Alex, > > > dma_alloc_coherent() already zeroes memory, so the extra call to > > memset() is unnecessary. > > One patch per driver, please. Nvm, someone's already beaten me to the punch! > > Thanks! > > -- > Martin K. Pe

[PATCH] spi: qup: Allow for compile-testing on !ARM

2020-09-04 Thread Alex Dewar
There seems no reason to restrict testing to ARM, so remove this constraint to improve test coverage. Build-tested with allyesconfig on x86. Signed-off-by: Alex Dewar --- drivers/spi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/Kconfig b/drivers/spi

[PATCH] iio: adc: rockchip_saradc: Allow compile-testing with !ARM

2020-09-04 Thread Alex Dewar
There seems no reason to allow for compile-testing on ARM only, so remove this restriction. Build-tested with allyesconfig on x86. Signed-off-by: Alex Dewar --- drivers/iio/adc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc

[PATCH] mtd: onenand: omap2: Allow for compile-testing on !ARM

2020-09-04 Thread Alex Dewar
There seems no particular reason for building on ARM only, so remove the restriction to increase test coverage. Build-tested on x86 with allyesconfig. Signed-off-by: Alex Dewar --- drivers/mtd/nand/onenand/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd

[PATCH] PCI: keystone: Enable compile-testing on !ARM

2020-09-04 Thread Alex Dewar
Currently the Keystone driver can only be compile-tested on ARM, but this restriction seems unnecessary. Get rid of it to increase test coverage. Build-tested on x86 with allyesconfig. Signed-off-by: Alex Dewar --- drivers/pci/controller/dwc/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH] staging: media: atomisp: Fix bool-related style issues

2020-09-05 Thread Alex Dewar
-off-by: Alex Dewar --- .../staging/media/atomisp/pci/atomisp_cmd.c | 5 ++--- drivers/staging/media/atomisp/pci/sh_css.c| 20 +-- .../media/atomisp/pci/sh_css_firmware.c | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/staging/media

Re: [PATCH] PCI: keystone: Enable compile-testing on !ARM

2020-09-06 Thread Alex Dewar
On Sun, Sep 06, 2020 at 02:19:44PM +0200, Krzysztof Kozlowski wrote: > On Fri, 4 Sep 2020 at 20:56, Alex Dewar wrote: > > > > Currently the Keystone driver can only be compile-tested on ARM, but > > this restriction seems unnecessary. Get rid of it to increase test > &

[PATCH v2] PCI: keystone: Enable compile-testing on !ARM

2020-09-06 Thread Alex Dewar
Currently the Keystone driver can only be compile-tested on ARM, but this restriction seems unnecessary. Get rid of it to increase test coverage. Build-tested with allyesconfig on x86, ppc, mips and riscv. Signed-off-by: Alex Dewar --- drivers/pci/controller/dwc/Kconfig | 4 ++-- 1 file

Re: [PATCH] power: supply: Add dependency to lego-ev3-battery Kconfig options

2020-08-17 Thread Alex Dewar
On Wed, Aug 12, 2020 at 02:12:57PM -0500, David Lechner wrote: > On 8/12/20 2:02 PM, Alex Dewar wrote: > > On Wed, Aug 12, 2020 at 10:24:30AM -0500, David Lechner wrote: > > > On 8/12/20 8:37 AM, Alex Dewar wrote: > > > > On Tue, Aug 11, 2020 at 09:24:10AM -0500, Dav

[PATCH] nfsd: Fix typo in comment

2020-08-17 Thread Alex Dewar
Missing "is". Signed-off-by: Alex Dewar --- Ahh I see. Is this better? --- fs/nfsd/nfs4xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 259d5ad0e3f47..309a6d5f895ae 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd

[PATCH RFC 0/2] simple sysfs wrappers for single values

2020-08-29 Thread Alex Dewar
Hi all, I've noticed there seems to have been a fair amount of discussion around the subject of possible helper methods for use in the context of sysfs show methods (which I haven't had a chance to go through in detail yet -- sorry!), so I thought I'd send out a couple of patches I've been working

[PATCH RFC 1/2] sysfs: add helpers for safely showing simple strings

2020-08-29 Thread Alex Dewar
ff-by: Alex Dewar --- fs/sysfs/file.c | 14 ++ include/linux/sysfs.h | 35 +++ 2 files changed, 49 insertions(+) diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index eb6897ab78e7..2a60e5c6392d 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -

[PATCH RFC 2/2] sysfs: add helper macro for showing simple integer values

2020-08-29 Thread Alex Dewar
h is that we can now statically check the type of the integer so that e.g. an unsigned long long will be formatted as %llu. This will fix cases where the wrong format string has been passed to sprintf(). Signed-off-by: Alex Dewar --- include/linux/sysfs.h | 31 +++ 1 file ch

Re: [PATCH] net: sockmap: Don't call bpf_prog_put() on NULL pointer

2020-10-14 Thread Alex Dewar
On 14/10/2020 10:32, Jakub Sitnicki wrote: On Mon, Oct 12, 2020 at 07:09 PM CEST, Alex Dewar wrote: If bpf_prog_inc_not_zero() fails for skb_parser, then bpf_prog_put() is called unconditionally on skb_verdict, even though it may be NULL. Fix and tidy up error path. Addresses-Coverity-ID

[PATCH] net/sunrpc: Fix return value from proc_do_xprt()

2020-10-24 Thread Alex Dewar
s-Coverity-ID: 1498033: Control flow issues (NO_EFFECT) Fixes: c09f56b8f68d ("net/sunrpc: Fix return value for sysctl sunrpc.transports") Signed-off-by: Alex Dewar --- net/sunrpc/sysctl.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/sysctl.c b

[PATCH] btrfs: check return value of filemap_fdatawrite_range()

2020-08-21 Thread Alex Dewar
In btrfs_dio_imap_begin(), filemap_fdatawrite_range() is called without checking the return value. Add a check to catch errors. Fixes: c0aaf9b7a114f ("btrfs: switch to iomap_dio_rw() for dio") Addresses-Coverity: ("Unused value") Signed-off-by: Alex Dewar --- fs/btrfs/inode

[PATCH 0/3] Fixes and cleanups for atomisp

2020-10-17 Thread Alex Dewar
Hi Mauro, I'm reposting this series [1] as, following the merge window, it now cleanly applies to both Linus' tree and to linux-next. I've made a minor fix to patch #1 (see patch for details) but the other two patches have just been rebased. Best, Alex [1] See https://lore.kernel.org/lkml/20200

[PATCH 2/3] staging: media: atomisp: Remove unhelpful info message

2020-10-17 Thread Alex Dewar
We don't really need to know that the LED pin reset successfully. Signed-off-by: Alex Dewar --- drivers/staging/media/atomisp/i2c/atomisp-lm3554.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp/i2c/at

[PATCH 3/3] staging: media: atomisp: Don't abort on error in module exit path

2020-10-17 Thread Alex Dewar
The function lm3554_remove() checks for the return code for lm3554_gpio_uninit() even though this is on the exit path and exits the function, leaving the variable flash unfreed. Instead, print a warning and free flash unconditionally. Signed-off-by: Alex Dewar --- .../staging/media/atomisp/i2c

[PATCH 1/3] staging: media: atomisp: Fix error path in lm3554_probe()

2020-10-17 Thread Alex Dewar
esource leaks") Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Alex Dewar Reviewed-by: Dan Carpenter --- v5: Check for error, not success (Dan), but do it correctly cf. v4 :) v4: Rebase v3: No changes v2: Fix a couple more leaks on error p

[PATCH 2/2] staging: media: atomisp: Remove unused function

2020-10-17 Thread Alex Dewar
The function ia_css_mipi_frame_specify() is not called from anywhere and the comment above its declaration states that it should be removed when there are no more users. So remove it. Signed-off-by: Alex Dewar --- drivers/staging/media/atomisp/pci/ia_css_mipi.h | 17 - drivers

[PATCH 1/2] staging: media: atomisp: Remove unnecessary if statement

2020-10-17 Thread Alex Dewar
The bodies of the if and else sections are the same, so just remove the check. Signed-off-by: Alex Dewar --- .../staging/media/atomisp/pci/atomisp_cmd.c | 27 +-- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b

BCM20702A0 bluetooth dongle not working

2020-11-13 Thread Alex Dewar
Hi all! I've just got a Broadcom BCM20702A0 USB Bluetooth dongle but it seems not to be working :-(. Whenever I search for devices only their MAC addresses appear (not their names) and I can't seem to pair with them. Logs are below. Any help would be massively appreciated :-) Alex Here's

Re: BCM20702A0 bluetooth dongle not working

2020-11-14 Thread Alex Dewar
iver here that'd be great. Best, Alex On 13/11/2020 17:45, Alex Dewar wrote: Hi all! I've just got a Broadcom BCM20702A0 USB Bluetooth dongle but it seems not to be working :-(. Whenever I search for devices only their MAC addresses appear (not their names) and I can't seem to

Re: [PATCH 2/2] ath11k: Handle errors if peer creation fails

2020-11-07 Thread Alex Dewar
On Sat, Nov 07, 2020 at 01:23:30PM +0200, Kalle Valo wrote: > Alex Dewar writes: > > > On Tue, Oct 06, 2020 at 10:26:28AM +0300, Kalle Valo wrote: > >> Alex Dewar writes: > >> > >> > ath11k_peer_create() is called without its return value being checke

Re: [PATCH] net/sunrpc: Fix return value from proc_do_xprt()

2020-11-07 Thread Alex Dewar
nd sorry for the noise! > > On Sat, Oct 24, 2020 at 03:52:40PM +0100, Alex Dewar wrote: > > Commit c09f56b8f68d ("net/sunrpc: Fix return value for sysctl > > sunrpc.transports") attempted to add error checking for the call to > > memory_read_from_buffer(), however

[PATCH] scsi: aic7xxx: Use kmemdup in two places

2020-09-09 Thread Alex Dewar
kmemdup can be used instead of kmalloc+memcpy. Replace two occurrences of this pattern. Issue identified with Coccinelle. Signed-off-by: Alex Dewar --- drivers/scsi/aic7xxx/aic79xx_core.c | 3 +-- drivers/scsi/aic7xxx/aic7xxx_core.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions

[PATCH] drm/bridge: dw-mipi-dsi: Use kmemdup cf. kmalloc+memcpy

2020-09-09 Thread Alex Dewar
kmemdup can be used instead of kmalloc+memcpy. Replace an occurrence of this pattern. Issue identified with Coccinelle. Signed-off-by: Alex Dewar --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge

Re: [PATCH] fs: omfs: use kmemdup() rather than kmalloc+memcpy

2020-09-09 Thread Alex Dewar
On 24/08/2020 22:17, Alex Dewar wrote: Issue identified with Coccinelle. Gentle ping? Signed-off-by: Alex Dewar --- fs/omfs/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index b76ec6b88ded..8867cefa79cf 100644 --- a/fs/omfs

[PATCH] ima: Use kmemdup rather than kmalloc+memcpy

2020-09-09 Thread Alex Dewar
Issue identified with Coccinelle. Signed-off-by: Alex Dewar --- security/integrity/ima/ima_policy.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index b4de33074b37..1de3140b334f 100644

[PATCH 2/2] w1: Remove pointless debug code

2020-09-09 Thread Alex Dewar
It doesn't seem obvious why zeroing sl before freeing it would help with debugging, so just remove this code. Signed-off-by: Alex Dewar --- drivers/w1/w1.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 4f597b0fd1da..02a0e66144a4 100644

[PATCH 1/2] w1: Use kfree_sensitive instead of memset+kfree

2020-09-09 Thread Alex Dewar
Issue identified with Coccinelle. Signed-off-by: Alex Dewar --- drivers/w1/w1.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index e58c7592008d..4f597b0fd1da 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -71,8 +71,7 @@ static

[PATCH] staging: media: atomisp: Use kvfree_sensitive in a few places

2020-09-09 Thread Alex Dewar
In the file pci/sh_css_params.c, there are a number of places where memset+kvfree is used, where kvfree_sensitive could be used instead. Fix these occurrences. Issue identified with Coccinelle. Signed-off-by: Alex Dewar --- .../staging/media/atomisp/pci/sh_css_params.c | 19

Re: [PATCH 1/2] w1: Use kfree_sensitive instead of memset+kfree

2020-09-09 Thread Alex Dewar
On 2020-09-09 20:41, Alex Dewar wrote: Issue identified with Coccinelle. Hmm, on second thoughts, I'm not sure this memory is so sensitive after all. Should we just remove the call to memset? Signed-off-by: Alex Dewar --- drivers/w1/w1.c | 3 +-- 1 file changed, 1 insertion(

Re: [PATCH] staging: media: atomisp: Use kvfree_sensitive in a few places

2020-09-09 Thread Alex Dewar
On 2020-09-09 21:06, Dan Carpenter wrote: On Wed, Sep 09, 2020 at 08:53:50PM +0100, Alex Dewar wrote: In the file pci/sh_css_params.c, there are a number of places where memset+kvfree is used, where kvfree_sensitive could be used instead. Fix these occurrences. This doesn't say *why

[PATCH] staging: media: atomisp: Don't do unnecessary zeroing of memory

2020-09-09 Thread Alex Dewar
In a few places in pci/sh_css_params.c, memset is used to zero memory immediately before it is freed. As none of these structs appear to contain sensitive information, just remove the calls to memset. Suggested-by: Dan Carpenter Signed-off-by: Alex Dewar --- drivers/staging/media/atomisp/pci

Re: [PATCH] drm/bridge: dw-mipi-dsi: Use kmemdup cf. kmalloc+memcpy

2020-09-21 Thread Alex Dewar
Hmm, I applied this already: commit 33f290811d4c1a09c4e92f5bf0458525835dbcba Author: Alex Dewar Date: Wed Sep 9 20:02:08 2020 +0100 drm/bridge: dw-mipi-dsi: Use kmemdup cf. kmalloc+memcpy kmemdup can be used instead of kmalloc+memcpy. Replace an occurrence of this pattern

[PATCH] staging: hikey9xx: Fix incorrect assignement

2020-09-21 Thread Alex Dewar
97107: Incorrect expression (COPY_PASTE_ERROR) Signed-off-by: Alex Dewar --- drivers/staging/hikey9xx/phy-hi3670-usb3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/hikey9xx/phy-hi3670-usb3.c b/drivers/staging/hikey9xx/phy-hi3670-usb3.c index 42dbc20a0b9a..4fc

[PATCH] btrfs: Fix potential null pointer deref

2020-09-21 Thread Alex Dewar
newly allocated") Addresses-Coverity: CID 1497103: Null pointer dereferences (REVERSE_INULL) Signed-off-by: Alex Dewar --- fs/btrfs/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index a5dae53c1e27..8f230b7bfe65 100644 ---

[PATCH] PCI: brcmstb: Add missing if statement

2020-09-21 Thread Alex Dewar
roperly. Fixes: ad3d29c77e1e ("PCI: brcmstb: Add control of rescal reset") Addresses-Coverity: CID 1497099: Control flow issues (UNREACHABLE) Signed-off-by: Alex Dewar --- drivers/pci/controller/pcie-brcmstb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/controller/pcie

[PATCH v2] PCI: brcmstb: Add missing if statement and error path

2020-09-21 Thread Alex Dewar
e that this bug means that this driver will not resume properly. Fixes: ad3d29c77e1e ("PCI: brcmstb: Add control of rescal reset") Addresses-Coverity: CID 1497099: Control flow issues (UNREACHABLE) Signed-off-by: Alex Dewar --- Hi Jim, Here's a new version of the patch. I added the

[PATCH v2] staging: hikey9xx: Fix incorrect assignment

2020-09-21 Thread Alex Dewar
97107: Incorrect expression (COPY_PASTE_ERROR) Signed-off-by: Alex Dewar --- v2: Fix my email address and a typo in title drivers/staging/hikey9xx/phy-hi3670-usb3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/hikey9xx/phy-hi3670-usb3.c b/drivers/staging/hik

[PATCH RESEND 0/5] atomisp: Fixes and cleanups

2020-09-21 Thread Alex Dewar
Hi Mauro, Over the last month I've sent a few scattered patches to fix various warnings from static analysers, but they seem to have fallen through the cracks? I'm reposting them here as a series to make them easier to review. If you do have any feedback that'd be great :) Best, Alex

[PATCH RESEND 1/5] staging: media: atomisp: Fix error path in lm3554_probe()

2020-09-21 Thread Alex Dewar
esource leaks") Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Alex Dewar Reviewed-by: Dan Carpenter --- .../media/atomisp/i2c/atomisp-lm3554.c| 53 +++ 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/

[PATCH RESEND 2/5] staging: media: atomisp: Remove unhelpful info message

2020-09-21 Thread Alex Dewar
We don't really need to know that the LED pin reset successfully. Signed-off-by: Alex Dewar --- drivers/staging/media/atomisp/i2c/atomisp-lm3554.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp/i2c/at

[PATCH RESEND 3/5] staging: media: atomisp: Don't do unnecessary zeroing of memory

2020-09-21 Thread Alex Dewar
In a few places in pci/sh_css_params.c, memset is used to zero memory immediately before it is freed. As none of these structs appear to contain sensitive information, just remove the calls to memset. Suggested-by: Dan Carpenter Signed-off-by: Alex Dewar --- drivers/staging/media/atomisp/pci

[PATCH RESEND 5/5] staging: media: atomisp: Fix bool-related style issues

2020-09-21 Thread Alex Dewar
-off-by: Alex Dewar --- .../staging/media/atomisp/pci/atomisp_cmd.c | 5 ++--- drivers/staging/media/atomisp/pci/sh_css.c| 20 +-- .../media/atomisp/pci/sh_css_firmware.c | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/staging/media

[PATCH RESEND 4/5] staging: media: atomisp: Don't abort on error in module exit path

2020-09-21 Thread Alex Dewar
The function lm3554_remove() checks for the return code for lm3554_gpio_uninit() even though this is on the exit path and exits the function, leaving the variable flash unfreed. Instead, print a warning and free flash unconditionally. Signed-off-by: Alex Dewar --- .../staging/media/atomisp/i2c

[PATCH] net: mvpp2: ptp: Fix unused variables

2020-09-10 Thread Alex Dewar
initialised. Fix by assigning to link the value of the bit test. Build-tested on x86. Fixes: 36cfd3a6e52b ("net: mvpp2: restructure "link status" interrupt handling") Signed-off-by: Alex Dewar --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 6 ++ 1 file changed, 2 insert

[PATCH] security: keys: Use kvfree_sensitive in a few places

2020-09-11 Thread Alex Dewar
In big_key.c, there are a few places where memzero_explicit + kvfree is used. It is better to use kvfree_sensitive instead, which is more readable and also prevents the compiler from eliding the call to memzero_explicit. Fix this. Signed-off-by: Alex Dewar --- security/keys/big_key.c | 9

[PATCH] scripts: kzfree.cocci: Deprecate use of kzfree

2020-09-11 Thread Alex Dewar
ensitive 2) Merge different rules for memset/memset_explicit as kzfree and kfree_sensitive are now equivalent 3) Rename script to kfree_sensitive.cocci In addition: 4) Move the script to the free/ subfolder, where it would seem to fit better Signed-off-by: Alex Dewar --- .../kfree_sensi

[PATCH v2] security: keys: Use kvfree_sensitive in a few places

2020-09-11 Thread Alex Dewar
In big_key.c, there are a few places where memzero_explicit + kvfree is used. Replace these with a single call to kvfree_sensitive, to make the code more readable. Signed-off-by: Alex Dewar --- v2 - Update commit message as per James Bottomley's suggestion security/keys/big_key.

[PATCH] iommu: fsl_pamu: Replace use of kzfree with kfree_sensitive

2020-09-11 Thread Alex Dewar
kzfree() is effectively deprecated as of commit 453431a54934 ("mm, treewide: rename kzfree() to kfree_sensitive()") and is now simply an alias for kfree_sensitive(). So just replace it with kfree_sensitive(). Signed-off-by: Alex Dewar --- drivers/iommu/fsl_pamu.c | 2 +- 1 file

Re: [PATCH] security: keys: Use kvfree_sensitive in a few places

2020-09-11 Thread Alex Dewar
On 2020-09-11 17:05, Denis Efremov wrote: Hi, same patch https://lkml.org/lkml/2020/8/27/168 Thanks, Denis Ah ok. Sorry for the noise! On 9/11/20 2:44 PM, Alex Dewar wrote: In big_key.c, there are a few places where memzero_explicit + kvfree is used. It is better to use kvfree_sensitive

Re: [PATCH] scripts: kzfree.cocci: Deprecate use of kzfree

2020-09-11 Thread Alex Dewar
more noise! On 9/11/20 4:49 PM, Alex Dewar wrote: kzfree() is effectively deprecated as of commit 453431a54934 ("mm, treewide: rename kzfree() to kfree_sensitive()"). It is currently just a legacy alias for kfree_sensitive(), which achieves the same thing. Update kzfree.cocci accordin

Re: linux-next: build failure after merge of the nand tree

2020-09-14 Thread Alex Dewar
On Mon, Sep 14, 2020 at 11:45:52AM +1000, Stephen Rothwell wrote: > Hi all, > > After merging the nand tree, today's linux-next build (x86_64 > allmodconfig) failed like this: > > drivers/mtd/nand/onenand/onenand_omap2.c:27:10: fatal error: > asm/mach/flash.h: No such file or directory >27 |

[PATCH] ath10k: sdio: remove reduntant check in for loop

2020-09-14 Thread Alex Dewar
erity: 1496984 ("Null pointer dereferences) Signed-off-by: Alex Dewar --- drivers/net/wireless/ath/ath10k/sdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index 81ddaafb6721..f31ab2ec2

[PATCH] SVM: nSVM: fix resource leak on error path

2020-09-14 Thread Alex Dewar
In svm_set_nested_state(), if nested_svm_vmrun_msrpm() returns false, then variables save and ctl will leak. Fix this. Fixes: 772b81bb2f9b ("SVM: nSVM: setup nested msr permission bitmap on nested state load") Signed-off-by: Alex Dewar --- arch/x86/kvm/svm/nested.c | 2 +- 1 file

[PATCH] mtd: rawnand: atmel: Check return values for nand_read_data_op

2020-09-14 Thread Alex Dewar
In atmel_nand_pmecc_read_pg(), nand_read_data_op() is called twice without the return values being checked for errors. Add these checks. Signed-off-by: Alex Dewar --- drivers/mtd/nand/raw/atmel/nand-controller.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a

Re: [PATCH v2] net: dsa: mt7530: Add some return-value checks

2020-09-24 Thread Alex Dewar
On 2020-09-24 13:13, Landen Chao wrote: Hi Alex, Thanks for your patch. By linux/scripts/checkpatch.pl On Sun, 2020-09-20 at 03:28 +0800, Alex Dewar wrote: [..] @@ -1631,9 +1635,11 @@ mt7530_setup(struct dsa_switch *ds) mt7530_rmw(priv, MT7530_PCR_P(i), PCR_MATRIX_MASK

[PATCH v3] net: dsa: mt7530: Add some return-value checks

2020-09-24 Thread Alex Dewar
call stack. Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch") Addresses-Coverity: 1496993 ("Uninitialized variables") Signed-off-by: Alex Dewar --- Hi Landen, Here you go! v3: - fix checkpatch warning about braces (Landen) v2:

[PATCH v2] net: dsa: mt7530: Add some return-value checks

2020-09-19 Thread Alex Dewar
call stack. Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch") Addresses-Coverity: 1496993 ("Uninitialized variables") Signed-off-by: Alex Dewar --- v2: - fix typo in commit message - split variable declarations onto multiple lines (Gu

Re: [PATCH v2] PCI: keystone: Enable compile-testing on !ARM

2020-09-19 Thread Alex Dewar
On 2020-09-06 20:51, Alex Dewar wrote: Currently the Keystone driver can only be compile-tested on ARM, but this restriction seems unnecessary. Get rid of it to increase test coverage. Friendly ping? Build-tested with allyesconfig on x86, ppc, mips and riscv. Signed-off-by: Alex Dewar

Re: [PATCH] staging: media: atomisp: Don't do unnecessary zeroing of memory

2020-09-19 Thread Alex Dewar
On 2020-09-09 21:48, Alex Dewar wrote: In a few places in pci/sh_css_params.c, memset is used to zero memory immediately before it is freed. As none of these structs appear to contain sensitive information, just remove the calls to memset. Friendly ping? Suggested-by: Dan Carpenter Signed

Re: [PATCH] drm/bridge: dw-mipi-dsi: Use kmemdup cf. kmalloc+memcpy

2020-09-19 Thread Alex Dewar
On 2020-09-11 13:57, Neil Armstrong wrote: On 09/09/2020 21:02, Alex Dewar wrote: kmemdup can be used instead of kmalloc+memcpy. Replace an occurrence of this pattern. Friendly ping? Issue identified with Coccinelle. Signed-off-by: Alex Dewar --- drivers/gpu/drm/bridge/synopsys/dw-mipi

Re: [PATCH] power: supply: charger-manager: Tidy function

2020-09-19 Thread Alex Dewar
On 2020-09-02 17:58, Alex Dewar wrote: check_charging_duration() contains some copy-pasted code, which makes it less readable. Refactor the function to be a bit tidier. Ping? I've also fixed a couple of typos. Signed-off-by: Alex Dewar --- drivers/power/supply/charger-manager.c

Re: [PATCH 2/2] staging: media: atomisp: Remove unhelpful info message

2020-09-19 Thread Alex Dewar
On 2020-09-03 19:31, Alex Dewar wrote: We don't really need to know that the LED pin reset successfully. Ping? Signed-off-by: Alex Dewar --- drivers/staging/media/atomisp/i2c/atomisp-lm3554.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/at

Re: [PATCH v2] staging: media: atomisp: Fix error path in lm3554_probe()

2020-09-19 Thread Alex Dewar
On 2020-09-03 19:24, Alex Dewar wrote: The error path for lm3554_probe() contains a number of bugs, including: * resource leaks * jumping to error labels out of sequence * not setting the return value appropriately Ping? Fix it up and give the labels more memorable names. This issue

[PATCH] media: vidtv: fix time conversion error

2020-09-16 Thread Alex Dewar
: 1496996 ("Integer handling issues") Fixes: f90cf6079bf6 ("media: vidtv: add a bridge driver") Signed-off-by: Alex Dewar --- drivers/media/test-drivers/vidtv/vidtv_mux.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/test-drivers/vidtv/vi

Re: [PATCH] ath10k: sdio: remove reduntant check in for loop

2020-09-16 Thread Alex Dewar
[snip] 'i' is only referenced once inside the loop to check boundary, the loop is actually iterating over cur_section, so i would make it clear in the loop statement, e.g.: Remove the break condition and the cur_section assignment at the end of the loop and use the loop statement to do it for yo

[PATCH] net: dsa: mt7530: Add some return-value checks

2020-09-16 Thread Alex Dewar
sa: mt7530: Add the support of MT7531 switch") Signed-off-by: Alex Dewar --- If it is not expected that these functions will throw errors (i.e. because the parameters passed will always be correct), we could dispense with the use of EINVAL errors and just use BUG*() macros instead. Let me kn

[PATCH v2] ath10k: sdio: remove redundant check in for loop

2020-09-16 Thread Alex Dewar
;Null pointer dereferences) Suggested-by: Saeed Mahameed Signed-off-by: Alex Dewar --- v2: refactor in the manner suggested by Saeed drivers/net/wireless/ath/ath10k/sdio.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/driver

Re: [PATCH] SVM: nSVM: fix resource leak on error path

2020-09-16 Thread Alex Dewar
On Tue, Sep 15, 2020 at 11:15:02AM +0200, Borislav Petkov wrote: > On Tue, Sep 15, 2020 at 12:07:25PM +0300, Maxim Levitsky wrote: > > I think that this patch is based on unmerged patch, since I don't see > > any memory allocation in nested_svm_vmrun_msrpm, nor out_free label. > > in nether kvm/mas

[PATCH] i40e: Fix use of uninitialized variable

2020-09-16 Thread Alex Dewar
quot;) Signed-off-by: Alex Dewar --- drivers/net/ethernet/intel/i40e/i40e_xsk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c index 6acede0acdca..18c05d23e15e 100644 --- a/drivers/net

Re: [PATCH] net: dsa: mt7530: Add some return-value checks

2020-09-16 Thread Alex Dewar
[snip] > > > > /* Enable Mediatek header mode on the cpu port */ > > mt7530_write(priv, MT7530_PVC_P(port), > > @@ -2275,7 +2279,7 @@ mt7531_cpu_port_config(struct dsa_switch *ds, int > > port) > > { > > struct mt7530_priv *priv = ds->priv; > > phy_interface_t interface; > > -

Re: [PATCH] net: dsa: mt7530: Add some return-value checks

2020-09-16 Thread Alex Dewar
On Wed, Sep 16, 2020 at 08:50:17PM +0100, Alex Dewar wrote: > In mt7531_cpu_port_config(), if the variable port is neither 5 nor 5, This should read "neither 5 nor 6", obviously. I'll fix in v2.

Re: [PATCH RESEND 0/5] atomisp: Fixes and cleanups

2020-09-22 Thread Alex Dewar
On 22/09/2020 09:11, Mauro Carvalho Chehab wrote: Em Mon, 21 Sep 2020 22:53:49 +0100 Alex Dewar escreveu: Hi Mauro, Over the last month I've sent a few scattered patches to fix various warnings from static analysers, but they seem to have fallen through the cracks? I'm reposting th

[PATCH REBASE 1/3] staging: media: atomisp: Fix error path in lm3554_probe()

2020-09-22 Thread Alex Dewar
esource leaks") Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Alex Dewar Reviewed-by: Dan Carpenter --- .../media/atomisp/i2c/atomisp-lm3554.c| 48 +++ 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/

[PATCH REBASE 2/3] staging: media: atomisp: Remove unhelpful info message

2020-09-22 Thread Alex Dewar
We don't really need to know that the LED pin reset successfully. Signed-off-by: Alex Dewar --- drivers/staging/media/atomisp/i2c/atomisp-lm3554.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp/i2c/at

[PATCH REBASE 0/3] atomisp: Rebased fixes

2020-09-22 Thread Alex Dewar
Hi Mauro, I've rebased the patches now, but there is a slight hiccup. For patches 2 and 3 of this series there will now be a conflict with commit 9289cdf39992 ("staging: media: atomisp: Convert to GPIO descriptors") in Greg's tree. I'm not sure what the best way to handle this is? The merge confl

[PATCH REBASE 3/3] staging: media: atomisp: Don't abort on error in module exit path

2020-09-22 Thread Alex Dewar
The function lm3554_remove() checks for the return code for lm3554_gpio_uninit() even though this is on the exit path and exits the function, leaving the variable flash unfreed. Instead, print a warning and free flash unconditionally. Signed-off-by: Alex Dewar --- .../staging/media/atomisp/i2c

Re: [PATCH REBASE 0/3] atomisp: Rebased fixes

2020-09-22 Thread Alex Dewar
On 22/09/2020 10:27, Mauro Carvalho Chehab wrote: Em Tue, 22 Sep 2020 10:09:07 +0100 Alex Dewar escreveu: Hi Mauro, I've rebased the patches now, but there is a slight hiccup. For patches 2 and 3 of this series there will now be a conflict with commit 9289cdf39992 ("staging: medi

Re: [PATCH REBASE 0/3] atomisp: Rebased fixes

2020-09-22 Thread Alex Dewar
[snip] > > That sounds more sensible. I've also just noticed that I introduced a bug in > > the first patch when rebasing it :-/, so let's hold off on the whole series > > and I'll do a proper tidy and resend after the next merge window. > > Is the bug the memory leak if lm3554_platform_data_func(

Re: [PATCH RFC 0/3] scsi: mpt: Refactor and port to dma_* interface

2020-09-16 Thread Alex Dewar
On Tue, Sep 15, 2020 at 10:12:06PM -0400, Martin K. Petersen wrote: > > Alex, > > > Any feedback would be greatly appreciated! > > Have you tested your changes? No, as I'm afraid I don't have the hardware. For patch #1 though, I'm not sure that's such an issue, as the refactoring was really si

<    1   2   3   >