[PATCH] staging/imx: Fix inconsistent IS_ERR and PTR_ERR

2018-02-28 Thread Gustavo A. R. Silva
Fix inconsistent IS_ERR and PTR_ERR in imx_csi_probe. The proper pointer to be passed as argument is pinctrl instead of priv->vdev. This issue was detected with the help of Coccinelle. Fixes: 52e17089d185 ("media: imx: Don't initialize vars that won't be used") Signed-off-

[PATCH] crypto : chtls_cm - Fix potential NULL pointer dereferences

2018-04-03 Thread Gustavo A. R. Silva
return value") Addresses-Coverity-ID: 1467449 ("Dereference null return value") Fixes: cc35c88ae4db ("crypto : chtls - CPL handler definition") Signed-off-by: Gustavo A. R. Silva --- drivers/crypto/chelsio/chtls/chtls_cm.c | 16 1 file changed, 16 insert

[PATCH v2] cifs: smb2pdu: Fix potential NULL pointer dereference

2018-04-03 Thread Gustavo A. R. Silva
12bf98416 ("cifs: add server->vals->header_preamble_size") Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Update subject. fs/cifs/smb2pdu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index f7741ce..e5ac47

Re: [PATCH] cifs: cifssmb: Fix potential NULL pointer dereference

2018-04-03 Thread Gustavo A. R. Silva
Hi, I noticed the subject was incorrect. Drop this patch, please. I just sent v2. Thanks -- Gustavo On 04/03/2018 03:55 PM, Gustavo A. R. Silva wrote: tcon->ses is being dereferenced before it is null checked, hence there is a potential null pointer dereference. Fix this by moving

[PATCH] lib: logic_pio: Fix potential NULL pointer dereference

2018-04-03 Thread Gustavo A. R. Silva
6259 ("lib: Add generic PIO mapping method") Signed-off-by: Gustavo A. R. Silva --- lib/logic_pio.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/logic_pio.c b/lib/logic_pio.c index 29cedea..30dfdce 100644 --- a/lib/logic_pio.c +++ b/lib/logic_pio.c @@ -

[PATCH] lib: logic_pio: Fix potential NULL pointer dereference

2018-04-03 Thread Gustavo A. R. Silva
6259 ("lib: Add generic PIO mapping method") Signed-off-by: Gustavo A. R. Silva --- lib/logic_pio.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/logic_pio.c b/lib/logic_pio.c index 29cedea..30dfdce 100644 --- a/lib/logic_pio.c +++ b/lib/logic_pio.c @@ -

[PATCH] cifs: cifssmb: Fix potential NULL pointer dereference

2018-04-03 Thread Gustavo A. R. Silva
12bf98416 ("cifs: add server->vals->header_preamble_size") Signed-off-by: Gustavo A. R. Silva --- fs/cifs/smb2pdu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index f7741ce..e5ac474 100644 --- a/fs/cifs/smb2pdu.c ++

[PATCH] net: thunderx: nicvf_main: Fix potential NULL pointer dereference

2018-04-03 Thread Gustavo A. R. Silva
Add null check on kmalloc() return value in order to prevent a null pointer dereference. Addresses-Coverity-ID: 1467429 ("Dereference null return value") Fixes: 37c3347eb247 ("net: thunderx: add ndo_set_rx_mode callback implementation for VF") Signed-off-by: Gustavo A. R. Sil

[crypto-chtls] Supicious code in chtls_io

2018-04-03 Thread Gustavo A. R. Silva
Hi all, While doing some static analysis I came across the following piece of code at drivers/crypto/chelsio/chtls/chtls_io.c:1203: 1203 if (!size) 1204 break; 1205 1206 if (unlikely(ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND)) 1207

Re: [PATCH] net: thunderx: nicvf_main: Fix potential NULL pointer dereference

2018-04-03 Thread Gustavo A. R. Silva
On 04/03/2018 04:47 PM, Eric Dumazet wrote: On 04/03/2018 02:29 PM, Gustavo A. R. Silva wrote: Add null check on kmalloc() return value in order to prevent a null pointer dereference. Addresses-Coverity-ID: 1467429 ("Dereference null return value") Fixes: 37c3347eb247 ("net

[PATCH v2] net: thunderx: nicvf_main: Fix potential NULL pointer dereferences

2018-04-03 Thread Gustavo A. R. Silva
Add null check on kmalloc() return value in order to prevent a null pointer dereference. Addresses-Coverity-ID: 1467429 ("Dereference null return value") Fixes: 37c3347eb247 ("net: thunderx: add ndo_set_rx_mode callback implementation for VF") Signed-off-by: Gustavo A. R. S

[PATCH] clk: samsung: s3c: Mark expected switch fall-through

2018-04-03 Thread Gustavo A. R. Silva
t; appears. Signed-off-by: Gustavo A. R. Silva --- This code was compiled with GCC 7.3.0 drivers/clk/samsung/clk-s3c2443.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/samsung/clk-s3c2443.c b/drivers/clk/samsung/clk-s3c2443.c index c46e6d5..7ebb87f 100644 ---

Re: [PATCH v2] net: thunderx: nicvf_main: Fix potential NULL pointer dereferences

2018-04-03 Thread Gustavo A. R. Silva
On 04/04/2018 01:36 AM, Eric Dumazet wrote: On 04/03/2018 03:04 PM, Gustavo A. R. Silva wrote: Add null check on kmalloc() return value in order to prevent a null pointer dereference. Addresses-Coverity-ID: 1467429 ("Dereference null return value") Fixes: 37c3347eb247 ("net

[PATCH] brcm80211: brcmsmac: phy_lcn: remove duplicate code

2018-04-04 Thread Gustavo A. R. Silva
Remove and refactor some code in order to avoid having identical code for different branches. Notice that this piece of code hasn't been modified since 2011. Addresses-Coverity-ID: 1226756 ("Identical code for different branches") Signed-off-by: Gustavo A. R. Silva --- drive

[rtlwifi-btcoex] Suspicious code in halbtc8821a1ant driver

2018-04-04 Thread Gustavo A. R. Silva
Hi all, While doing some static analysis I came across the following piece of code at drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c:1581: 1581 static void btc8821a1ant_act_bt_sco_hid_only_busy(struct btc_coexist *btcoexist, 1582

Re: [RESEND] SHASH_DESC_ON_STACK macro

2018-04-05 Thread Gustavo A. R. Silva
Hi Herbert, On 03/27/2018 05:07 AM, Herbert Xu wrote: On Fri, Mar 23, 2018 at 02:09:46PM -0500, Gustavo A. R. Silva wrote: Hi Herbert, There is an ongoing effort to remove all VLAs from the code base [1] and while working on that I came across the following macro at include/crypto/hash.h:154

Re: [PATCH v2] Bluetooth: Remove VLA usage in aes_cmac

2018-04-05 Thread Gustavo A. R. Silva
Hi Marcel, On 04/05/2018 02:23 AM, Marcel Holtmann wrote: so I took this patch back out of bluetooth-next before sending the pull request. I think the discussion on how to fix SHASH_DESC_ON_STACK macro needs to complete first. Once that has concluded we can revisit if this patch is still nee

Re: [PATCH v2] Bluetooth: Remove VLA usage in aes_cmac

2018-04-05 Thread Gustavo A. R. Silva
On 04/05/2018 03:46 AM, Marcel Holtmann wrote: By the way, what is you opinion on replacing crypto_shash_descsize(ctx) with PAGE_SIZE / 8 in SHASH_DESC_ON_STACK? Does it work for you? isn’t that just waste? Agree. The macro itself is this. #define SHASH_DESC_ON_STACK(shash, ctx)

[PATCH] qtnfmac: pearl: pcie: fix memory leak in qtnf_fw_work_handler

2018-04-05 Thread Gustavo A. R. Silva
In case memory resources for fw were succesfully allocated, release them before jumping to fw_load_fail. Addresses-Coverity-ID: 1466092 ("Resource leak") Fixes: c3b2f7ca4186 ("qtnfmac: implement asynchronous firmware loading") Signed-off-by: Gustavo A. R. Silva ---

[PATCH] ieee802154: mcr20a: Fix memory leak in mcr20a_probe

2018-04-05 Thread Gustavo A. R. Silva
Free allocated memory for pdata before return. Addresses-Coverity-ID: 1466096 ("Resource leak") Fixes: 8c6ad9cc5157 ("ieee802154: Add NXP MCR20A IEEE 802.15.4 transceiver driver") Signed-off-by: Gustavo A. R. Silva --- drivers/net/ieee802154/mcr20a.c | 9 ++--- 1 file c

Re: [PATCH] qtnfmac: pearl: pcie: fix memory leak in qtnf_fw_work_handler

2018-04-05 Thread Gustavo A. R. Silva
ronous firmware loading") Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c | 4 1 file changed, 4 insertions(+) Thanks for the patch! Glad to help. :) Reviewed-by: Sergey Matyukevich Thanks -- Gustavo

[PATCH] watchdog: sch311x_wdt: Mark expected switch fall-through

2018-03-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case I replaced "Fall" with a proper "Fall through" comment, which is what GCC is expecting to find. Signed-off-by: Gustavo A. R.

[PATCH] watchdog: w83977f_wdt: Mark expected switch fall-through

2018-03-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case I replaced "Fall" with a proper "Fall through" comment, which is what GCC is expecting to find. Signed-off-by: Gustavo A. R.

[PATCH] watchdog: wafer5823wdt: Mark expected switch fall-through

2018-03-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case I replaced "Fall" with a proper "Fall through" comment, which is what GCC is expecting to find. Signed-off-by: Gustavo A. R.

Re: [PATCH] watchdog: wafer5823wdt: Mark expected switch fall-through

2018-03-27 Thread Gustavo A. R. Silva
On 03/27/2018 04:05 PM, Guenter Roeck wrote: On 03/27/2018 12:33 PM, Gustavo A. R. Silva wrote: In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case I replaced "Fall" with a proper &qu

Re: [PATCH 01/11] media: tm6000: fix potential Spectre variant 1

2018-04-26 Thread Gustavo A. R. Silva
Hi Mauro, On 04/23/2018 02:17 PM, Mauro Carvalho Chehab wrote: Em Mon, 23 Apr 2018 14:11:02 -0500 Thanks, I 'll mark this series as rejected at patchwork.linuxtv.org. Please feel free to resubmit any patch if they represent a real threat, adding a corresponding description about the threat scen

[PATCH] staging: wilc1000: fix infinite loop and out-of-bounds access

2018-04-30 Thread Gustavo A. R. Silva
wilc1000: refactor scan() to free kmalloc memory on failure cases") Signed-off-by: Gustavo A. R. Silva --- BTW... at first sight it seems to me that variables slot_id and i should be of type unsigned instead of signed. drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- 1 file cha

[PATCH] typec: tcpm: Fix incorrect 'and' operator

2018-04-30 Thread Gustavo A. R. Silva
Currently, logical and is being used instead of *bitwise* and. Fix this by using a proper bitwise and operator. Addresses-Coverity-ID: 1468455 ("Logical vs. bitwise operator") Fixes: 64f7c494a3c0 ("typec: tcpm: Add support for sink PPS related messages") Signed-off-by:

Re: [PATCH][next] media: ispstat: don't dereference user_cfg before a null check

2018-04-30 Thread Gustavo A. R. Silva
Hi Sakari, On 04/30/2018 10:15 AM, Sakari Ailus wrote: Isn't there a guarantee that new_buf won't be NULL ? The new_buf pointer comes from the parg variable in video_usercopy(), which should always point to a valid buffer given that the ioctl number specifies a non-zero size. Fair question. Af

[PATCH] kernel: sys: fix potential Spectre v1

2018-05-14 Thread Gustavo A. R. Silva
licy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- kernel/sys.c | 5 + 1 file changed, 5 ins

Re: [PATCH 01/11] media: tm6000: fix potential Spectre variant 1

2018-05-14 Thread Gustavo A. R. Silva
Hi Mauro, On 04/26/2018 06:42 PM, Mauro Carvalho Chehab wrote: I noticed you changed the status of this series from rejected to new. Yes. Also, there are other similar issues in media/pci/ Well, the issues will be there everywhere on all media drivers. I marked your patches because I ne

Re: [PATCH v2] apparmor: secid: fix error return value in error handling path

2018-05-15 Thread Gustavo A. R. Silva
Hi Colin, Sorry for the late response. I've been on the road for the last 12 days and I'm just back. On 05/04/2018 09:36 AM, Colin Ian King wrote: Hi Gustavo, if you are using the coverity scan bug tracking, please can you mark a bug as being worked on by yourself so I don't work on it at t

Re: [PATCH 01/11] media: tm6000: fix potential Spectre variant 1

2018-05-15 Thread Gustavo A. R. Silva
On 05/15/2018 09:16 AM, Dan Carpenter wrote: I'm curious about how you finally resolved to handle these issues. I noticed Smatch is no longer reporting them. There was no direct fix for it, but maybe this patch has something to do with the smatch error report cleanup: commit 3ad3b7a2ebaefa

[PATCH] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-16 Thread Gustavo A. R. Silva
with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/usb/usbip/vhci_sysfs.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/usbip/vhci_sysfs.c b/drivers/

Re: [PATCH 01/11] media: tm6000: fix potential Spectre variant 1

2018-05-16 Thread Gustavo A. R. Silva
On 05/15/2018 02:39 PM, Dan Carpenter wrote: Dan, These are all the Spectre media issues I see smatch is reporting in linux-next-20180515: drivers/media/cec/cec-pin-error-inj.c:170 cec_pin_error_inj_parse_line() warn: potential spectre issue 'pin->error_inj_args' drivers/media/dvb-core/dvb_ca

[PATCH] rsi_91x_mac80211: fix structurally dead code

2018-04-26 Thread Gustavo A. R. Silva
ot;) Fixes: 4fd6c4762f37 ("rsi: roaming enhancements") Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/

[PATCH] rsi_91x_usb: fix uninitialized variable

2018-04-26 Thread Gustavo A. R. Silva
2f37 ("rsi: disable fw watchdog timer during reset") Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/rsi/rsi_91x_usb.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c in

Re: [PATCH] watchdog: smsc37b787_wdt: Mark expected switch fall-through

2019-02-28 Thread Gustavo A. R. Silva
On 2/26/19 11:45 AM, Guenter Roeck wrote: >> >> >> Friendly ping: >> >> Who can take this? >> > > It is queued in my watchdog-next branch. Usually Wim will pick it up from > there. > > Guenter > Awesome. :) Thanks! -- Gustavo

[PATCH v2] x86/syscalls: Mark expected switch fall-throughs

2019-02-28 Thread Gustavo A. R. Silva
: KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough=3,) Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Expand commit text as requested by Thomas Gleixner. - Add Kees' Reviewed-by. arch/x86/include/asm/syscall.h | 28 1 file ch

Re: [PATCH] scsi: mpt3sas: Add missing breaks in switch statements

2019-02-28 Thread Gustavo A. R. Silva
On 2/27/19 8:37 AM, Martin K. Petersen wrote: > > Gustavo, > >> Fix the following warnings by adding the proper missing breaks: >> >> drivers/scsi/mpt3sas/mpt3sas_base.c: In function >> ‘_base_display_OEMs_branding’: >> drivers/scsi/mpt3sas/mpt3sas_base.c:3548:4: warning: this statement may f

[PATCH v2] scsi: NCR5380: Mark expected switch fall-through

2019-02-28 Thread Gustavo A. R. Silva
is modified in accordance with what GCC is expecting to find. This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Update commit log. - Move code comment after the default label and retain reason for fall-through in comm

Re: [PATCH] perf/core: Mark expected switch fall-through

2019-02-28 Thread Gustavo A. R. Silva
Hi all, Friendly ping: Who can ack or review this, please? Thanks -- Gustavo On 2/12/19 2:54 PM, Gustavo A. R. Silva wrote: > In preparation to enabling -Wimplicit-fallthrough, mark switch > cases where we are expecting to fall through. > > This patch fixes the following warning:

[PATCH] genirq: Mark expected switch fall-through

2019-02-28 Thread Gustavo A. R. Silva
AGS += $(call cc-option,-Wimplicit-fallthrough=3,) Signed-off-by: Gustavo A. R. Silva --- kernel/irq/manage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 9ec34a2a6638..1401afa0d58a 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manag

Re: [PATCH] perf/core: Mark expected switch fall-through

2019-03-01 Thread Gustavo A. R. Silva
On 3/1/19 7:53 AM, Arnaldo Carvalho de Melo wrote: > Em Thu, Feb 28, 2019 at 03:31:31PM -0600, Gustavo A. R. Silva escreveu: >> Hi all, >> >> Friendly ping: >> >> Who can ack or review this, please? > > I'm applying it, thanks. > Great. Thanks, Arnaldo. -- Gustavo

[PATCH] ASoC: ab8500: Mark expected switch fall-through

2019-03-01 Thread Gustavo A. R. Silva
gt;dev, ^~~ sound/soc/codecs/ab8500-codec.c:2132:2: note: here default: ^~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- sound/soc/codecs/ab8500-codec.c | 1 + 1 file chan

[PATCH] drm/amdgpu/gfx_v8_0: Mark expected switch fall-through

2019-03-01 Thread Gustavo A. R. Silva
0:2: note: here case CHIP_CARRIZO: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 1 + 1 file changed, 1 insertion(+) diff --gi

[PATCH] drm/amdgpu/powerplay: Fix missing break in switch statement

2019-03-01 Thread Gustavo A. R. Silva
") Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smum

Re: [PATCH v3] mtd: rawnand: Mark expected switch fall-throughs

2019-03-01 Thread Gustavo A. R. Silva
Hi all, Friendly ping: Who can take this, please? Thanks -- Gustavo On 2/8/19 11:49 AM, Gustavo A. R. Silva wrote: > In preparation to enabling -Wimplicit-fallthrough, mark switch > cases where we are expecting to fall through. > > This patch fixes the following warning: > >

Re: [PATCH] drm/amdgpu/powerplay: Fix missing break in switch statement

2019-03-01 Thread Gustavo A. R. Silva
On 3/1/19 5:54 PM, Alex Deucher wrote: > On Fri, Mar 1, 2019 at 4:51 PM Gustavo A. R. Silva > wrote: >> >> Add missing break statement in order to prevent the code from falling >> through to case SMU_Discrete_DpmTable. >> >> This bug was found tha

Re: [PATCH v3] mtd: rawnand: Mark expected switch fall-throughs

2019-03-01 Thread Gustavo A. R. Silva
On 3/1/19 4:39 PM, Richard Weinberger wrote: > Am Freitag, 1. März 2019, 22:38:18 CET schrieb Gustavo A. R. Silva: >> Hi all, >> >> Friendly ping: >> >> Who can take this, please? > > /me points to Miquel. :) > Thanks, Richard. Hopefully, Miquel will take this for 5.1. :) -- Gustavo

[PATCH][next] net/mlx5e: Remove redundant assignment

2019-03-02 Thread Gustavo A. R. Silva
Remove redundant assignment to tun_entropy->enabled. Addesses-Coverity-ID: 1477328 ("Unused value") Fixes: 97417f6182f8 ("net/mlx5e: Fix GRE key by controlling port tunnel entropy calculation") Signed-off-by: Gustavo A. R. Silva --- drivers/net/ethernet/mellanox/mlx5/

[PATCH] mtd: ubi: wl: Fix uninitialized variable

2019-03-02 Thread Gustavo A. R. Silva
ubi: Expose the bitrot interface") Signed-off-by: Gustavo A. R. Silva --- drivers/mtd/ubi/wl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 40f838d54b0f..cf07d869724f 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd

Re: [PATCH] x86: uv: Fix potential NULL pointer dereference of kmalloc_node

2019-03-02 Thread Gustavo A. R. Silva
Hi Aditya, On 3/2/19 3:09 PM, Aditya Pakki wrote: > kmalloc_node might fail to allocate memory for thp field. This fix > attempts to avoid a potential NULL pointer dereference. > If this was detected by any static analyzer, please mention the tool in the commit log. Also, notice that this code d

Re: [PATCH] isdn: mISDN: Fix potential NULL pointer dereference of kzalloc

2019-03-02 Thread Gustavo A. R. Silva
On 3/2/19 3:20 PM, Aditya Pakki wrote: > Allocating memory via kzalloc for phi may fail and causes a > NULL pointer dereference. This patch avoids such a scenario. > Was this detected by Coccinelle? If so, please mention it in the commit log. Thanks -- Gustavo > Signed-off-by: Aditya Pakki

[mt76/mt7603/mac] Question about missing variable assignment

2019-03-02 Thread Gustavo A. R. Silva
Hi all, The following piece of code in drivers/net/wireless/mediatek/mt76/mt7603/mac.c is missing a variable assignment before line 1058. Notice that there is a potential execution path in which variable *i* is compared against magic number 15 at line 1075 without being initialized previously (th

Re: [PATCH] ALSA: isa/wavefront: Fix potential Spectre v1 vulnerabilities

2019-04-15 Thread Gustavo A. R. Silva
Hi all, Friendly ping: Who can take this? Thanks -- Gustavo On 3/26/19 1:32 PM, Gustavo A. R. Silva wrote: > header->number and i are indirectly controlled by user-space, hence leading > to a potential exploitation of the Spectre variant 1 vulnerability. > > This issue was de

Re: [PATCH] ALSA: isa/wavefront: Fix potential Spectre v1 vulnerabilities

2019-04-15 Thread Gustavo A. R. Silva
On 4/15/19 5:34 PM, Takashi Iwai wrote: > On Mon, 15 Apr 2019 21:35:17 +0200, > Gustavo A. R. Silva wrote: >> >> Hi all, >> >> Friendly ping: >> >> Who can take this? > > All platforms that support ISA boards are so old and they don't

Re: [PATCH] mtd: cfi_util: mark expected switch fall-throughs

2019-04-16 Thread Gustavo A. R. Silva
Hi Miquel, On 4/16/19 12:24 PM, Miquel Raynal wrote: > Hi Gustavo, > > "Gustavo A. R. Silva" wrote on Mon, 15 Apr > 2019 07:57:11 -0500: > >> Hi Miquel, >> >> On 4/15/19 3:44 AM, Miquel Raynal wrote: >>> Hi Gustavo, >>> >>&g

[PATCH v2] staging: greybus: power_supply: use struct_size() helper

2019-04-17 Thread Gustavo A. R. Silva
) with: struct_size(resp, props, props_count) This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Rebase on top of 47830c1127ef ("staging: greybus: power_supply: fix prop-descriptor request size") drivers/staging/greybus/power_su

Re: [PATCH v2] staging: greybus: power_supply: use struct_size() helper

2019-04-18 Thread Gustavo A. R. Silva
On 4/18/19 1:27 AM, Johan Hovold wrote: > On Wed, Apr 17, 2019 at 01:44:40PM -0500, Gustavo A. R. Silva wrote: >> Make use of the struct_size() helper instead of an open-coded version >> in order to avoid any potential type mistakes, in particular in the >> context in whi

Re: [PATCH] watchdog: machzwd: Mark expected switch fall-through

2019-04-24 Thread Gustavo A. R. Silva
Hi Guenter, I wonder if you took this in you watchdog-next branch. Thanks -- Gustavo On 4/10/19 3:51 PM, Gustavo A. R. Silva wrote: > > > On 4/10/19 3:35 PM, Guenter Roeck wrote: >> On Wed, Apr 10, 2019 at 01:49:05PM -0500, Gustavo A. R. Silva wrote: >>> In preparatio

Re: [PATCH] watchdog: machzwd: Mark expected switch fall-through

2019-04-24 Thread Gustavo A. R. Silva
On 4/24/19 12:28 PM, Guenter Roeck wrote: > On Wed, Apr 24, 2019 at 12:01:03PM -0500, Gustavo A. R. Silva wrote: >> Hi Guenter, >> >> I wonder if you took this in you watchdog-next branch. >> > > It is in branch watchdog-next of > git://git.kernel.org/p

[PATCH] platform/x86: sony-laptop: Fix unintentional fall-through

2019-04-24 Thread Gustavo A. R. Silva
thread of discussion: https://lore.kernel.org/patchwork/patch/959782/ Fixes: 33a04454527e ("sony-laptop: Add SNY6001 device handling (sonypi reimplementation)") Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/platform/x86/sony-laptop.c | 8 +--- 1 file

Re: [PATCH] lib/siphash.c: mark expected switch fall-throughs

2019-04-25 Thread Gustavo A. R. Silva
gt;>> where we are expecting to fall through. >>> >>> This patch aims to suppress up to 18 missing-break-in-switch false >>> positives on some architectures. >>> >>> Cc: Jason A. Donenfeld >>> Cc: Gustavo A. R. Silva >>> Cc: K

Re: [PATCH] staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro

2019-04-25 Thread Gustavo A. R. Silva
Hi Vatsala, On 4/25/19 1:33 PM, Vatsala Narang wrote: > Challenge suggested by coccinelle. > I think you mean *change*. See more comments below... > Replace bit shifting on 1 with the BIT(x) macro. > Coccinelle script: > > @@ > expression c; > @@ > > -(1 << c) > +BIT(c) > > Signed-off-by:

Re: [PATCH] nvmet-fc: use zero-sized array and struct_size() in kzalloc()

2019-03-12 Thread Gustavo A. R. Silva
On 3/12/19 2:33 PM, Christoph Hellwig wrote: > Thanks, > > applied to nvme-5.2. > Great. Thanks, Christoph. -- Gustavo

Re: [PATCH 1/2] firewire: annotate implicit fall through

2019-03-13 Thread Gustavo A. R. Silva
Mathieu, On 3/13/19 3:28 PM, Mathieu Malaterre wrote: > ping ? > I have sent the following patch to address all these warnings in firewire: https://lore.kernel.org/patchwork/patch/1040737/ and, as this is being ignored, I'll add it to my tree for 5.2. Thanks -- Gustavo > On Mon, Jan 14, 2019

Re: [PATCH v2] lib/siphash.c: annotate implicit fall throughs

2019-03-13 Thread Gustavo A. R. Silva
On 3/13/19 3:34 PM, Jason A. Donenfeld wrote: > Conceptually this seems pretty reasonable. Though, style-wise, perhaps > you might want to put those breaks on the next line too, i.e. s/; > break;/;\n\t\tbreak;/? > I agree. With that, you can add my: Acked-by: Gustavo A. R. Si

Re: [PATCH] firewire: mark expected switch fall-throughs

2019-03-14 Thread Gustavo A. R. Silva
On 3/14/19 5:00 AM, Stefan Richter wrote: [..] >> diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c >> index 35e784cffc23..7e5c98840b80 100644 >> --- a/drivers/firewire/core-iso.c >> +++ b/drivers/firewire/core-iso.c >> @@ -308,7 +308,7 @@ static int manage_channel(struct

[PATCH] KVM: x86: Mark expected switch fall-throughs

2019-01-25 Thread Gustavo A. R. Silva
[-Wimplicit-fallthrough=] arch/x86/kvm/vmx/vmx.c:1773:6: warning: this statement may fall through [-Wimplicit-fallthrough=] Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva

[PATCH] x86/kernel: Mark expected switch fall-throughs

2019-01-25 Thread Gustavo A. R. Silva
2: note: here case MP_IRQPOL_ACTIVE_LOW: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- arch/x86/kernel/apic/io_apic.c | 2 ++ arch/x86/kernel/cpu/cacheinfo.c |

[PATCH] x86/events: Mark expected switch fall-throughs

2019-01-25 Thread Gustavo A. R. Silva
icit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- arch/x86/events/intel/core.c | 2 ++ arch/x86/events/intel/lbr.c | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 40e12cfc87f6..ece43e7e4569 100644 --- a/arch/x86/events/i

[PATCH] lib/cmdline.c: mark expected switch fall-throughs

2019-01-25 Thread Gustavo A. R. Silva
=] Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- lib/cmdline.c | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/cmdline.c b/lib/cmdline.c index 171c19b6888e

[PATCH] lib/assoc_array: mark expected switch fall-through

2019-01-25 Thread Gustavo A. R. Silva
This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- lib/assoc_array.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/assoc_array.c b/lib/assoc_array.c index c6659cb37033..0b61d3b77e5c 100644 --- a/lib/assoc_array.c +++ b

[PATCH] ASN.1: mark expected switch fall-throughs

2019-01-25 Thread Gustavo A. R. Silva
may fall through [-Wimplicit-fallthrough=] Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- lib/asn1_decoder.c | 4 1 file changed, 4 insertions(+) diff --git a/lib

[PATCH] x86/insn-eval: Mark expected switch fall-through

2019-01-25 Thread Gustavo A. R. Silva
-fallthrough=] if (insn->addr_bytes == 2) ^ arch/x86/lib/insn-eval.c:182:2: note: here case -EDOM: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- arch/

[PATCH] mtd: rawnand: mark expected switch fall-throughs

2019-01-25 Thread Gustavo A. R. Silva
h=3 This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- drivers/mtd/nand/onenand/onenand_base.c | 2 ++ drivers/mtd/nand/raw/diskonchip.c | 1 + drivers/mtd/nand/raw/nand_base.c| 3 +++ drivers/mtd/nand/raw/nand_legac

[PATCH] drm/amd/powerplay: Fix missing break in switch

2019-01-25 Thread Gustavo A. R. Silva
thanks to the ongoing efforts to enabling -Wimplicit-fallthrough. Fixes: cd70f3d6e3fa ("drm/amd/powerplay: PP/DAL interface changes for dynamic clock switch") Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 1 + 1 file

Re: [PATCH] lib/cmdline.c: mark expected switch fall-throughs

2019-01-25 Thread Gustavo A. R. Silva
On 1/25/19 6:18 PM, Kees Cook wrote: > On Sat, Jan 26, 2019 at 9:31 AM Gustavo A. R. Silva > wrote: >> >> In preparation to enabling -Wimplicit-fallthrough, mark switch >> cases where we are expecting to fall through. >> >> This patch fixes the following

Re: [PATCH] ASN.1: mark expected switch fall-throughs

2019-01-25 Thread Gustavo A. R. Silva
On 1/25/19 6:38 PM, Kees Cook wrote: > On Sat, Jan 26, 2019 at 9:49 AM Gustavo A. R. Silva > wrote: >> >> In preparation to enabling -Wimplicit-fallthrough, mark switch >> cases where we are expecting to fall through. >> >> This patch fixes the following wa

Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs

2019-01-26 Thread Gustavo A. R. Silva
Hey Boris, On 1/26/19 3:52 AM, Boris Brezillon wrote: > On Fri, 25 Jan 2019 15:09:50 -0600 > "Gustavo A. R. Silva" wrote: > >> diff --git a/drivers/mtd/nand/raw/nandsim.c b/drivers/mtd/nand/raw/nandsim.c >> index 933d1a629c51..d33e15dc4cdc 100644 >> --- a/dr

Re: [PATCH 0/2] Fix NULL pointer dereference and use struct_size()

2019-01-26 Thread Gustavo A. R. Silva
On 1/26/19 7:20 AM, Linus Walleij wrote: > On Tue, Jan 22, 2019 at 5:55 PM Gustavo A. R. Silva > wrote: > >> The first patch in this series fixes a potential NULL pointer >> dereference by adding a NULL check. A tag for stable has been >> added for this patch. >

Re: [PATCH] x86/insn-eval: Mark expected switch fall-through

2019-01-26 Thread Gustavo A. R. Silva
Boris, On 1/26/19 3:47 AM, Borislav Petkov wrote: > On Fri, Jan 25, 2019 at 02:55:20PM -0600, Gustavo A. R. Silva wrote: >> In preparation to enabling -Wimplicit-fallthrough, mark switch >> cases where we are expecting to fall through. >> >> This patch fixes the follow

Re: linux-next: no release today

2019-01-27 Thread Gustavo A. R. Silva
On 1/27/19 6:32 PM, Stephen Rothwell wrote: > Hi all, > > There will be no linux-next release today, normal service will resume > tomorrow. > Good to know. Thanks, Stephen. -- Gustavo

[PATCH v2] mtd: rawnand: mark expected switch fall-throughs

2019-01-28 Thread Gustavo A. R. Silva
h=3 This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Add extra /* fall through */ comment in nandsim.c file. drivers/mtd/nand/onenand/onenand_base.c | 2 ++ drivers/mtd/nand/raw/diskonchip.c | 1 + driv

Re: [PATCH] mtd: rawnand: mark expected switch fall-throughs

2019-01-28 Thread Gustavo A. R. Silva
Miquel, Boris, On 1/28/19 3:13 AM, Miquel Raynal wrote: > Hi Boris, > > Boris Brezillon wrote on Sat, 26 Jan 2019 > 17:54:29 +0100: > >> On Sat, 26 Jan 2019 07:48:50 -0600 >> "Gustavo A. R. Silva" wrote: >> >>> Hey Boris, >>> >

[PATCH] ALSA: isa/wavefront: Fix potential Spectre v1 vulnerabilities

2019-03-26 Thread Gustavo A. R. Silva
be completed with a dependent load/store [1]. [1] https://lore.kernel.org/lkml/20180423164740.gy17...@dhcp22.suse.cz/ Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- sound/isa/wavefront/wavefront_synth.c | 17 + 1 file changed, 17 insertions(+) diff --git a/soun

Re: [PATCH] signal: annotate implicit fall through

2019-04-01 Thread Gustavo A. R. Silva
[+cc Andrew] On 3/13/19 3:27 PM, Mathieu Malaterre wrote: > ping ? > Acked-by: Gustavo A. R. Silva Maybe Andrew can take this? Thanks -- Gustavo > On Mon, Jan 14, 2019 at 9:35 PM Mathieu Malaterre wrote: >> >> There is a plan to build the kernel with -Wimplicit-fa

[PATCH] staging: ralink-gdma: Use struct_size() in kzalloc()

2019-04-03 Thread Gustavo A. R. Silva
the above, replace gdma_dma_alloc_desc() with kzalloc() and use the new struct_size() helper. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/ralink-gdma/ralink-gdma.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions

[PATCH] staging: greybus: power_supply: Use struct_size() helper

2019-04-03 Thread Gustavo A. R. Silva
) with: struct_size(resp, props, props_count) This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/staging/greybus/power_supply.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/power_supply.c b/drivers

[PATCH] perf script: Fix memory leaks in list_scripts()

2019-04-08 Thread Gustavo A. R. Silva
In case memory resources for *buf* and *paths* were allocated, jump to *out* and release them before return. Addresses-Coverity-ID: 1444328 ("Resource leak") Fixes: 6f3da20e151f ("perf report: Support builtin perf script in scripts menu") Signed-off-by: Gustavo A. R. Silva

[PATCH] tools/power turbostat: fix file descriptor leaks

2019-04-08 Thread Gustavo A. R. Silva
Fix file descriptor leaks by closing fp before return. Addresses-Coverity-ID: 1444591 ("Resource leak") Addresses-Coverity-ID: 1444592 ("Resource leak") Fixes: 5ea7647b333f ("tools/power turbostat: Warn on bad ACPI LPIT data") Signed-off-by: Gustavo A. R. Silva

[PATCH] perf header: Fix lock/unlock imbalances

2019-04-08 Thread Gustavo A. R. Silva
ders to perf.data") Fixes: 606f972b1361 ("perf bpf: Save bpf_prog_info information as headers to perf.data") Signed-off-by: Gustavo A. R. Silva --- tools/perf/util/header.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tools/perf/util/h

Re: [PATCH] perf header: Fix lock/unlock imbalances

2019-04-08 Thread Gustavo A. R. Silva
On 4/8/19 1:22 PM, Song Liu wrote: > > >> On Apr 8, 2019, at 10:33 AM, Gustavo A. R. Silva >> wrote: >> >> Fix lock/unlock imbalances by refactoring the code a bit and adding >> calls to up_write() before return. >> >> Addresses-Coverity-ID:

Re: [PATCH] perf header: Fix lock/unlock imbalances

2019-04-08 Thread Gustavo A. R. Silva
On 4/8/19 2:35 PM, Arnaldo Carvalho de Melo wrote: > Em Mon, Apr 08, 2019 at 01:26:09PM -0500, Gustavo A. R. Silva escreveu: >> >> >> On 4/8/19 1:22 PM, Song Liu wrote: >>> >>> >>>> On Apr 8, 2019, at 10:33 AM, Gustavo A. R. Silva

Re: [PATCH] perf header: Fix lock/unlock imbalances

2019-04-08 Thread Gustavo A. R. Silva
On 4/8/19 3:00 PM, Arnaldo Carvalho de Melo wrote: > Em Mon, Apr 08, 2019 at 02:52:52PM -0500, Gustavo A. R. Silva escreveu: >> >> >> On 4/8/19 2:35 PM, Arnaldo Carvalho de Melo wrote: >>> Em Mon, Apr 08, 2019 at 01:26:09PM -0500, Gustavo A. R. Silva escreveu: &g

Re: linux-next: manual merge of the kspp-gustavo tree with Linus' tree

2019-04-08 Thread Gustavo A. R. Silva
On 4/7/19 4:17 PM, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the kspp-gustavo tree got a conflict in: > > arch/x86/include/asm/syscall.h > > between commits: > > b35f549df1d7 ("syscalls: Remove start and number from > syscall_get_arguments() args") > 32d9258662

[PATCH] genirq/devres: Use struct_size() in devm_kzalloc()

2019-04-10 Thread Gustavo A. R. Silva
sz is not necessary, hence it is removed. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- kernel/irq/devres.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/irq/devres.c b/kernel/irq/devres.c index f808c6a97dcc

Re: [PATCH] staging: greybus: power_supply: Use struct_size() helper

2019-04-10 Thread Gustavo A. R. Silva
Hi Johan, On 4/4/19 1:57 AM, Johan Hovold wrote: > > This patch looks good, but I noticed a bug here in the current code, > which should be fixed before applying this clean up. > > sizeof(req) should have been sizeof(*req) above. > Good catch. >> - sizeof(struct gb

Re: [PATCH] staging: greybus: power_supply: Use struct_size() helper

2019-04-10 Thread Gustavo A. R. Silva
Johan, On 4/4/19 2:24 AM, Johan Hovold wrote: > On Thu, Apr 04, 2019 at 08:09:51AM +0100, Rui Miguel Silva wrote: >> Hi Gustavo, >> Thanks a lot for the patch. >> >> On Wed 03 Apr 2019 at 21:58, Gustavo A. R. Silva wrote: >>> Make use of the struct_si

<    5   6   7   8   9   10   11   12   13   14   >