[PATCH] video: fbdev: via_aux_vt1636: remove VLA usage

2018-03-07 Thread Gustavo A. R. Silva
In preparation to enabling -Wvla, remove VLA and replace it with a fixed-length array instead. Also, remove variable 'len'. Notice that no new IDs have been added in seven years. Signed-off-by: Gustavo A. R. Silva --- drivers/video/fbdev/via/via_aux_vt1636.c | 6 +++--- 1 file

[PATCH] rtc: remove VLA usage

2018-03-07 Thread Gustavo A. R. Silva
In preparation to enabling -Wvla, remove VLA and replace it with a fixed-length array instead. Signed-off-by: Gustavo A. R. Silva --- drivers/rtc/rtc-bq32k.c | 2 +- drivers/rtc/rtc-mcp795.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-bq32k.c b

[RESEND] SHASH_DESC_ON_STACK macro

2018-03-23 Thread Gustavo A. R. Silva
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: #define SHASH_DESC_ON_STACK(shash, ctx) \ char __##shash##_desc[sizeof(struct shash_des

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

2018-04-05 Thread Gustavo A. R. Silva
On 04/05/2018 03:24 PM, Stephen Boyd wrote: Quoting Gustavo A. R. Silva (2018-04-03 18:09:31) In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case I replaced the comma wiht a dash, s/wiht/with

Re: [PATCH v2] net: thunderx: rework mac addresses list to u64 array

2018-04-06 Thread Gustavo A. R. Silva
#x27;d be nice if you add: Reported-by: Gustavo A. R. Silva Thanks -- Gustavo Signed-off-by: Vadim Lomovtsev --- Changes from v1 to v2: - C99 syntax: update xcast_addr_list struct field mc[0] -> mc[]; --- drivers/net/ethernet/cavium/thunder/nic.h| 7 +- drivers

Re: [PATCH v2] net: thunderx: rework mac addresses list to u64 array

2018-04-06 Thread Gustavo A. R. Silva
On 04/06/2018 06:43 AM, Vadim Lomovtsev wrote: Hi Gustavo, On Fri, Apr 06, 2018 at 06:36:28AM -0500, Gustavo A. R. Silva wrote: Hi Vadim, On 04/06/2018 06:14 AM, Vadim Lomovtsev wrote: From: Vadim Lomovtsev It is too expensive to pass u64 values via linked list, instead allocate array

[PATCH] staging: ks7010_sdio: fix NULL pointer dereference and memory leak

2018-04-12 Thread Gustavo A. R. Silva
by null checking priv before dererefencing it and free netdev before return. Addresses-Coverity-ID: 1467844 ("Explicit null dereferenced") Signed-off-by: Gustavo A. R. Silva --- drivers/staging/ks7010/ks7010_sdio.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) di

Re: [PATCH] staging: ks7010_sdio: fix NULL pointer dereference and memory leak

2018-04-12 Thread Gustavo A. R. Silva
Hi Dan, On 04/12/2018 10:08 AM, Dan Carpenter wrote: I added Colin to the Cc list. On Thu, Apr 12, 2018 at 09:30:09AM -0500, Gustavo A. R. Silva wrote: priv is being dereferenced when it is still null, hence there is an explicit null pointer dereference at line 935: free_netdev(priv->net_

[PATCH v2] staging: ks7010_sdio: fix memory leak

2018-04-12 Thread Gustavo A. R. Silva
Memory allocated for netdev at line 854: netdev = alloc_etherdev(sizeof(*priv)); is not being free'd before return, hence there is a memory leak. Fix this by freeing netdev before return. Addresses-Coverity-ID: 1467844 Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Update subjec

[PATCH v3] staging: ks7010_sdio: fix NULL pointer dereference and memory leak

2018-04-12 Thread Gustavo A. R. Silva
quot;Explicit null dereferenced") Suggested-by: Dan Carpenter Signed-off-by: Gustavo A. R. Silva --- Changes in v3: - Update subject and improve changelog. - Add Suggested-by: Dan Carpenter Changes in v2: - Update subject and commit changelog. - Just directly free netdev. Thanks to Dan Car

[PATCH] cifs: smb2ops: Fix NULL check in smb2_query_symlink

2018-04-13 Thread Gustavo A. R. Silva
null checking err_iov.iov_base instead of err_buf. Also, notice that err_buf no longer needs to be initialized to NULL. Addresses-Coverity-ID: 1467876 ("Logically dead code") Fixes: 2d636199e400 ("cifs: Change SMB2_open to return an iov for the error parameter") Signed-off-by: Gus

[PATCH] drm/i915/gvt/scheduler: fix potential NULL pointer dereference

2018-03-19 Thread Gustavo A. R. Silva
ot;drm/i915/gvt: keep oa config in shadow ctx") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gvt/scheduler.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c index 068

Re: [PATCH] drm/i915/gvt/scheduler: fix potential NULL pointer dereference

2018-03-19 Thread Gustavo A. R. Silva
Hi Chris, On 03/19/2018 03:38 PM, Chris Wilson wrote: Quoting Gustavo A. R. Silva (2018-03-19 19:30:53) _workload_ is being dereferenced before it is null checked, hence there is a potential null pointer dereference. Fix this by moving the pointer dereference after _workload_ has been null

Re: [PATCH] drm/i915/gvt/scheduler: fix potential NULL pointer dereference

2018-03-19 Thread Gustavo A. R. Silva
On 03/19/2018 04:23 PM, Chris Wilson wrote: Quoting Gustavo A. R. Silva (2018-03-19 20:50:12) Hi Chris, On 03/19/2018 03:38 PM, Chris Wilson wrote: Quoting Gustavo A. R. Silva (2018-03-19 19:30:53) _workload_ is being dereferenced before it is null checked, hence there is a potential null

[PATCH] Bluetooth: Remove VLA usage in aes_cmac

2018-03-20 Thread Gustavo A. R. Silva
is easy to lose track of how big a VLA can get. Thus, we can end up having runtime failures that are hard to debug. Also, fixed as part of the directive to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva --- net/bluetooth/smp.c | 16

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

2018-03-20 Thread Gustavo A. R. Silva
Hi, I've just discovered an issue in this patch. Please, drop it. I'll send v2 shortly. Thanks -- Gustavo On 03/20/2018 06:34 PM, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA and replace it with dynamic memory allocation instead. The use of stack Varia

[PATCH v2] Bluetooth: Remove VLA usage in aes_cmac

2018-03-20 Thread Gustavo A. R. Silva
is easy to lose track of how big a VLA can get. Thus, we can end up having runtime failures that are hard to debug. Also, fixed as part of the directive to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Fix memory leak

[PATCH] mac80211: aes-cmac: remove VLA usage

2018-03-21 Thread Gustavo A. R. Silva
it is easy to lose track of how big a VLA can get. Thus, we can end up having runtime failures that are hard to debug. Also, fixed as part of the directive to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva --- net/mac80211/aes_cmac.c | 36

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

2018-03-21 Thread Gustavo A. R. Silva
-by: Gustavo A. R. Silva --- Changes in v2: - Fix memory leak in previous patch. net/bluetooth/smp.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel Awesome. Thanks, Marcel. -- Gustavo

Re: [PATCH] netfilter: nfnetlink_cthelper: Remove VLA usage

2018-03-21 Thread Gustavo A. R. Silva
On 03/20/2018 07:36 AM, Pablo Neira Ayuso wrote: On Mon, Mar 12, 2018 at 07:21:38PM -0500, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA and replace it with dynamic memory allocation. From a security viewpoint, the use of Variable Length Arrays can be a vector for

Re: [PATCH] mac80211: aes-cmac: remove VLA usage

2018-03-21 Thread Gustavo A. R. Silva
On 03/21/2018 08:48 AM, Johannes Berg wrote: On Wed, 2018-03-21 at 08:42 -0500, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLAs and replace them with dynamic memory allocation instead. The use of stack Variable Length Arrays needs to be avoided, as they can be a

Re: [PATCH] mac80211: aes-cmac: remove VLA usage

2018-03-21 Thread Gustavo A. R. Silva
On 03/21/2018 08:58 AM, Johannes Berg wrote: On Wed, 2018-03-21 at 08:57 -0500, Gustavo A. R. Silva wrote: SHA_DESC_ON_STACK is currently being used in multiple places. But, yeah, I think we can define multiple macros of the same kind and adjust to the characteristics of each the component

[RFC] SHASH_DESC_ON_STACK macro

2018-03-21 Thread Gustavo A. R. Silva
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: #define SHASH_DESC_ON_STACK(shash, ctx) \ char __##shash##_desc[sizeof(struct shash_desc

[PATCH] drm/i915/gvt: Mark expected switch fall-through in handle_g2v_notification

2018-03-22 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1466154 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gvt/handlers.c | 1 + 1 file changed, 1 insertion(+) di

[PATCH] net/mlx5/core/fpga/ipsec: Fix use-after-free

2018-03-22 Thread Gustavo A. R. Silva
ot;net/mlx5: Add flow-steering commands for FPGA IPSec implementation") Signed-off-by: Gustavo A. R. Silva --- drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c b/dri

[PATCH] drm/i915/gvt/scheduler: Remove unnecessary NULL checks in sr_oa_regs

2018-03-22 Thread Gustavo A. R. Silva
The checks are misleading and not required [1]. [1] https://lkml.org/lkml/2018/3/19/1792 Addresses-Coverity-ID: 1466017 Cc: Chris Wilson Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/i915/gvt/scheduler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu

Re: [PATCH] net/mlx5/core/fpga/ipsec: Fix use-after-free

2018-03-22 Thread Gustavo A. R. Silva
Hi Yuval, On 03/22/2018 01:32 PM, Yuval Shaia wrote: On Thu, Mar 22, 2018 at 01:03:42PM -0500, Gustavo A. R. Silva wrote: _rule_ is being freed and then dereferenced by accessing rule->ctx Fix this by copying the value returned by PTR_ERR(rule->ctx) into a local variable for its sa

[PATCH v2] net/mlx5: Fix use-after-free

2018-03-22 Thread Gustavo A. R. Silva
ot;net/mlx5: Add flow-steering commands for FPGA IPSec implementation") Reviewed-by: Yuval Shaia Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Use a short subject prefix as suggested by Yuval Shaia. - Add Yuval's Reviewed-by. drivers/net/ethernet/mellanox/mlx5/core/fpga/ips

Re: [PATCH] caif_dev: use true and false for boolean values

2018-03-22 Thread Gustavo A. R. Silva
Hi all, I was just wondering about the status of this patch. Thanks! -- Gustavo On 03/05/2018 04:05 PM, Gustavo A. R. Silva wrote: Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva

[PATCH] rtc: isl12022: use true and false for boolean values

2018-03-22 Thread Gustavo A. R. Silva
Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/rtc/rtc-isl12022.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-isl12022.c b/drivers

[PATCH] dpaa_eth: use true and false for boolean values

2018-03-22 Thread Gustavo A. R. Silva
Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net

[PATCH] qed: Use true and false for boolean values

2018-03-22 Thread Gustavo A. R. Silva
Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/net/ethernet/qlogic/qed/qed_dev.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers

[PATCH] video: fbdev: aty128fb: use true and false for boolean values

2018-03-22 Thread Gustavo A. R. Silva
Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/video/fbdev/aty/aty128fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/aty

Re: [PATCH] rtc: remove VLA usage

2018-03-07 Thread Gustavo A. R. Silva
Hi Alexandre, On 03/07/2018 03:25 PM, Alexandre Belloni wrote: On 07/03/2018 at 14:11:33 -0600, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA and replace it with a fixed-length array instead. You should probably explain what VLA is and why this is important to do

Re: [PATCH] rtc: remove VLA usage

2018-03-07 Thread Gustavo A. R. Silva
Hi Alexandre, On 03/07/2018 03:25 PM, Alexandre Belloni wrote: On 07/03/2018 at 14:11:33 -0600, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA and replace it with a fixed-length array instead. You should probably explain what VLA is and why this is important to do

Re: [PATCH] rtc: remove VLA usage

2018-03-07 Thread Gustavo A. R. Silva
On 03/07/2018 05:01 PM, Alexandre Belloni wrote: On 07/03/2018 at 16:39:51 -0600, Gustavo A. R. Silva wrote: Hi Alexandre, On 03/07/2018 03:25 PM, Alexandre Belloni wrote: On 07/03/2018 at 14:11:33 -0600, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA and replace

Re: [PATCH] rtc: remove VLA usage

2018-03-07 Thread Gustavo A. R. Silva
On 03/07/2018 05:12 PM, Alexandre Belloni wrote: On 07/03/2018 at 17:09:22 -0600, Gustavo A. R. Silva wrote: On 03/07/2018 05:01 PM, Alexandre Belloni wrote: On 07/03/2018 at 16:39:51 -0600, Gustavo A. R. Silva wrote: Hi Alexandre, On 03/07/2018 03:25 PM, Alexandre Belloni wrote: On 07

[PATCH v2] rtc: remove VLA usage

2018-03-07 Thread Gustavo A. R. Silva
hus, we can end up having segfaults that are hard to debug. Also, fixed as part of the directive to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Update changelog as per Alexandre Belloni request. - Update the code for

[PATCH] rtc: s5m: Remove VLA usage

2018-03-08 Thread Gustavo A. R. Silva
hus, we can end up having segfaults that are hard to debug. Also, fixed as part of the directive to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva --- drivers/rtc/rtc-s5m.c | 15 +-- 1 file changed, 9 insertions(+), 6 deleti

Re: [PATCH] video: fbdev: via_aux_vt1632: remove VLA usage

2018-03-08 Thread Gustavo A. R. Silva
Hi Emil, On 03/08/2018 05:58 AM, Emil Velikov wrote: Hi Gustavo, On 7 March 2018 at 19:54, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA and replace it with a fixed-length array instead. Also, remove variable 'len'. What is the reason behind adding -Wvla

[PATCH] video: fbdev: via: remove VLA usage

2018-03-08 Thread Gustavo A. R. Silva
In preparation to enabling -Wvla, remove VLA usage. Also, fixed as part of the directive to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva --- drivers/video/fbdev/via/via_aux_sii164.c | 2 +- drivers/video/fbdev/via/via_aux_vt1631.c | 2

Re: [PATCH] rtc: s5m: Remove VLA usage

2018-03-08 Thread Gustavo A. R. Silva
On 03/08/2018 11:58 AM, Kees Cook wrote: On Thu, Mar 8, 2018 at 9:20 AM, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLAs and replace them with fixed-length arrays instead. From a security viewpoint, the use of Variable Length Arrays can be a vector for stack

[PATCH] power: supply: da9150-fg: remove VLA usage

2018-03-08 Thread Gustavo A. R. Silva
the future. Fixed as part of the directive to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva --- drivers/power/supply/da9150-fg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/da9150-fg.c b/drivers/po

[PATCH] pktgen: Remove VLA usage

2018-03-08 Thread Gustavo A. R. Silva
In preparation to enabling -Wvla, remove VLA usage and replace it with a fixed-length array instead. Signed-off-by: Gustavo A. R. Silva --- David, I'm not sure how often this function is being called and, depending on the frequency it may be worth to use dynamic memory allocation in

Re: [PATCH 4/4] video: Remove stack VLA usage

2018-03-08 Thread Gustavo A. R. Silva
I sent a patch for this six hours ago: https://patchwork.kernel.org/patch/10268591/ -- Gustavo On 03/09/2018 12:11 AM, Tycho Andersen wrote: On Thu, Mar 08, 2018 at 10:01:07PM -0800, Joe Perches wrote: On Fri, 2018-03-09 at 16:50 +1100, Tobin C. Harding wrote: The kernel would like to have

Re: [PATCH] power: supply: da9150-fg: remove VLA usage

2018-03-09 Thread Gustavo A. R. Silva
On 03/09/2018 05:36 AM, Adam Thomson wrote: On 09 March 2018 04:58, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA usage and replace it with fixed-length arrays. It seems that the length of array 'buf' will not exceed DA9150_QIF_SHORT_SIZE bytes (2 byt

[PATCH v2] power: supply: da9150-fg: remove VLA usage

2018-03-09 Thread Gustavo A. R. Silva
] https://marc.info/?l=kernel-hardening&m=152059600524753&w=2 Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Use DA9150_QIF_LONG_SIZE instead of DA9150_QIF_BYTE_SIZE as the maximum size for array 'buf'. Thanks to Adam Thomson for the feedback on this. - Update changel

Re: [PATCH] pktgen: Remove VLA usage

2018-03-09 Thread Gustavo A. R. Silva
On 03/09/2018 10:58 AM, David Miller wrote: From: "Gustavo A. R. Silva" Date: Thu, 8 Mar 2018 23:43:40 -0600 In preparation to enabling -Wvla, remove VLA usage and replace it with a fixed-length array instead. Signed-off-by: Gustavo A. R. Silva --- David, I'm not sure

Re: [PATCH] EDAC, sb_edac: Remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
On 03/13/2018 05:48 AM, Borislav Petkov wrote: On Mon, Mar 12, 2018 at 05:52:13PM -0500, Gustavo A. R. Silva wrote: Do you mean just adding a code comment? No, I mean #define MAX_INTERLEAVE (max_t(unsigned int, ARRAY_SIZE(knl_interleave_list), ... which computes the max of all three array

[PATCH v2] EDAC, sb_edac: Remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
In preparation to enabling -Wvla, remove VLA and replace it with a fixed-length array instead. Fixed as part of the directive to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Use macro max_t to compute the max of all

Re: linux-next: build warning after merge of the net-next tree

2018-03-13 Thread Gustavo A. R. Silva
Hi Stephen, On 03/13/2018 01:11 AM, Stephen Rothwell wrote: Hi all, After merging the net-next tree, today's linux-next build (sparc defconfig) produced this warning: net/core/pktgen.c: In function 'pktgen_if_write': net/core/pktgen.c:1710:1: warning: the frame size of 1048 bytes is larger tha

Re: [PATCH v2] EDAC, sb_edac: Remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
On 03/13/2018 08:21 AM, Mauro Carvalho Chehab wrote: Em Tue, 13 Mar 2018 06:20:34 -0500 "Gustavo A. R. Silva" escreveu: In preparation to enabling -Wvla, remove VLA and replace it with a fixed-length array instead. Fixed as part of the directive to remove all VLAs from the ker

[PATCH v3] EDAC, sb_edac: Remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
In preparation to enabling -Wvla, remove VLA and replace it with a fixed-length array instead. Fixed as part of the directive to remove all VLAs from the kernel: https://lkml.org/lkml/2018/3/7/621 Reviewed-by: Mauro Carvalho Chehab Signed-off-by: Gustavo A. R. Silva --- Changes in v3

[PATCH] drm/vc4_validate: Remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
: Gustavo A. R. Silva --- drivers/gpu/drm/vc4/vc4_validate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c index 2db485a..eec76af 100644 --- a/drivers/gpu/drm/vc4/vc4_validate.c +++ b/drivers/gpu/drm/vc4

[PATCH] drm/nouveau/secboot: remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c b/drivers

[PATCH] iio: potentiometer: ds1803: remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
: Gustavo A. R. Silva --- drivers/iio/potentiometer/ds1803.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/potentiometer/ds1803.c b/drivers/iio/potentiometer/ds1803.c index 9b0ff4a..6bf12c9 100644 --- a/drivers/iio/potentiometer/ds1803.c +++ b/drivers/iio

Re: [PATCH] drm/nouveau/secboot: remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
Hi David, On 03/13/2018 11:10 AM, David Laight wrote: From: Gustavo A. R. Silva Sent: 13 March 2018 14:48 In preparation to enabling -Wvla, remove VLA. In this particular case directly use macro NVKM_MSGQUEUE_CMDLINE_SIZE instead of local variable cmdline_size. Also, remove cmdline_size as it

[PATCH v2] drm/nouveau/secboot: remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
kernel: https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Use sizeof(buf) instead of NVKM_MSGQUEUE_CMDLINE_SIZE. This change is based on the feedback provided by David Laight. Thanks David. drivers/gpu/drm/nouveau/nvkm/subdev/secboot

Re: [PATCH] iio: potentiometer: ds1803: remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
On 03/13/2018 11:24 AM, Himanshu Jha wrote: Hi Gustavo, On Tue, Mar 13, 2018 at 10:23:43AM -0500, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA. In this particular case use macro ARRAY_SIZE so the length of array _result_ can be computed at preprocessing time. The

Re: [PATCH] iio: potentiometer: ds1803: remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
On 03/13/2018 11:59 AM, Himanshu Jha wrote: On Tue, Mar 13, 2018 at 11:31:19AM -0500, Gustavo A. R. Silva wrote: On 03/13/2018 11:24 AM, Himanshu Jha wrote: Hi Gustavo, On Tue, Mar 13, 2018 at 10:23:43AM -0500, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA. In

Re: [PATCH] iio: potentiometer: ds1803: remove VLA usage

2018-03-13 Thread Gustavo A. R. Silva
On 03/13/2018 11:59 AM, Himanshu Jha wrote: On Tue, Mar 13, 2018 at 11:31:19AM -0500, Gustavo A. R. Silva wrote: On 03/13/2018 11:24 AM, Himanshu Jha wrote: Hi Gustavo, On Tue, Mar 13, 2018 at 10:23:43AM -0500, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA. In

Re: linux-next: build warning after merge of the net-next tree

2018-03-13 Thread Gustavo A. R. Silva
On 03/13/2018 10:33 AM, David Miller wrote: From: "Gustavo A. R. Silva" Date: Tue, 13 Mar 2018 06:46:24 -0500 Hi Stephen, On 03/13/2018 01:11 AM, Stephen Rothwell wrote: Hi all, After merging the net-next tree, today's linux-next build (sparc defconfig) produced this wa

[PATCH] pktgen: Fix memory leak in pktgen_if_write

2018-03-14 Thread Gustavo A. R. Silva
_buf_ is an array and the one that must be freed is _tp_ instead. Fixes: a870a02cc963 ("pktgen: use dynamic allocation for debug print buffer") Reported-by: Wang Jian Signed-off-by: Gustavo A. R. Silva --- net/core/pktgen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

Re: [PATCH] pktgen: use dynamic allocation for debug print buffer

2018-03-14 Thread Gustavo A. R. Silva
Arnd: Thanks for the fix. On 03/13/2018 10:02 PM, Wang Jian wrote: + kfree(buf); free tb? buf is an array. Wang: Thanks for the report. I already sent a patch to fix this: https://patchwork.kernel.org/patch/10281587/ -- Gustavo On Wed, Mar 14, 2018 at 8:25 AM, David Miller wrote: F

[PATCH v4] EDAC, sb_edac: Remove VLA usage

2018-03-14 Thread Gustavo A. R. Silva
-off-by: Gustavo A. R. Silva --- Changes in v4: - Remove max_interleave. Changes in v3: - Update macro MAX_INTERLEAVE in order to avoid too long lines. This change is based on Mauro's feedback. - Update changelog with Mauro's Reviewed-by. Changes in v2: - Use macro max_t to compu

Re: [PATCH v3] EDAC, sb_edac: Remove VLA usage

2018-03-14 Thread Gustavo A. R. Silva
On 03/14/2018 01:03 PM, Borislav Petkov wrote: [..] struct interleave_pkg { unsigned char start; @@ -1899,7 +1904,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci, int n_rir, n_sads, n_tads, sad_way, sck_xch; int

Re: linux-next: build warning after merge of the f2fs tree

2018-11-26 Thread Gustavo A. R. Silva
On 11/26/18 4:22 PM, Jaegeuk Kim wrote: On 11/27, Stephen Rothwell wrote: [..] Oh, thanks~ Is this okay? Yep. This fix the warning. :) Thanks, Jaegeuk -- Gustavo From 79e24f1509e5b6a07069be9cc8163969da78c57a Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Mon, 26 Nov 2018 14:20:32

[PATCH 25/41] scsi: lpfc: lpfc_nportdisc: Mark expected switch fall-through

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/scsi/lpfc/lpfc_nportdisc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc

Re: mtd: cfi_cmdset_0020: Mark expected switch fall-throughs

2018-11-09 Thread Gustavo A. R. Silva
On 11/9/18 1:40 PM, Boris Brezillon wrote: Applied to http://git.infradead.org/linux-mtd.git mtd/next, thanks. Thanks, Boris. -- Gustavo

[PATCH] ASoC: pxa-ssp: mark expected switch fall-through

2018-07-02 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- sound/soc/pxa/pxa-ssp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index 01d5469

[PATCH] /dev/mem: Mark expected switch fall-through

2018-07-02 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/char/mem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/mem.c b/drivers/char/mem.c index ffeb60d..4b00d6a 100644 --- a

[PATCH] dmaengine: nbpfaxi: Mark expected switch fall-through

2018-07-02 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/dma/nbpfaxi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c index 2f9974d..8c7b2e8

[PATCH] drbd: mark expected switch fall-throughs

2018-07-02 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Warning level 2 was used in this case: -Wimplicit-fallthrough=2 Signed-off-by: Gustavo A. R. Silva --- drivers/block/drbd/drbd_receiver.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH] firewire: core-topology: mark expected switch fall-through

2018-07-02 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/firewire/core-topology.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firewire/core-topology.c b/drivers/firewire/core

[PATCH] iscsi_ibft: Mark expected switch fall-through

2018-07-02 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/firmware/iscsi_ibft.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c

[PATCH] HID: roccat: Mark expected switch fall-through

2018-07-02 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/hid/hid-roccat-kone.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c

[PATCH] Drivers: hv: hv_kvp: Mark expected switch fall-through

2018-07-02 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/hv/hv_kvp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c index 5eed1e7..9b1adcb 100644

Re: [PATCH] iio: sca3000: Mark expected switch fall-through

2018-07-07 Thread Gustavo A. R. Silva
Hi Jonathan, On 07/07/2018 12:03 PM, Jonathan Cameron wrote: > On Tue, 3 Jul 2018 14:39:34 -0500 > "Gustavo A. R. Silva" wrote: > >> In preparation to enabling -Wimplicit-fallthrough, mark switch cases >> where we are expecting to fall through. >>

[PATCH] iio: sca3000: Fix missing return in switch

2018-07-07 Thread Gustavo A. R. Silva
ntrol") Reported-by: Jonathan Cameron Signed-off-by: Gustavo A. R. Silva --- drivers/iio/accel/sca3000.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c index 4dceb75..4964561 100644 --- a/drivers/iio/accel/sca3000.c +++ b/drivers

[PATCH] ext4: use swap macro in mext_page_double_lock

2018-07-09 Thread Gustavo A. R. Silva
Make use of the swap macro and remove unnecessary variable *tmp*. This makes the code easier to read and maintain. Also, reduces the stack usage. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- fs/ext4/move_extent.c | 4 +--- 1 file changed, 1

Re: [PATCH] pinctrl: baytrail: Mark expected switch fall-throughs

2018-07-09 Thread Gustavo A. R. Silva
Hi Linus, On 07/09/2018 08:42 AM, Linus Walleij wrote: > On Thu, Jul 5, 2018 at 5:51 PM Gustavo A. R. Silva > wrote: > >> In preparation to enabling -Wimplicit-fallthrough, mark switch cases >> where we are expecting to fall through. >> >> Addresses-Coveri

[PATCH] xfs_bmap_util: use swap macro

2018-07-09 Thread Gustavo A. R. Silva
Make use of the swap macro and remove some unnecessary variables. This makes the code easier to read and maintain. Also, reduces the stack usage. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- fs/xfs/xfs_bmap_util.c | 13 ++--- 1 file changed

[PATCH] xfs_attr_leaf: use swap macro in xfs_attr3_leaf_rebalance

2018-07-09 Thread Gustavo A. R. Silva
Make use of the swap macro and remove some unnecessary variables. This makes the code easier to read and maintain. Also, reduces the stack usage. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- fs/xfs/libxfs/xfs_attr_leaf.c | 13 +++-- 1 file

Re: [PATCH] xfs_bmap_util: use swap macro

2018-07-09 Thread Gustavo A. R. Silva
Hi Darrick, On 07/09/2018 11:39 AM, Darrick J. Wong wrote: > On Mon, Jul 09, 2018 at 09:05:39AM -0500, Gustavo A. R. Silva wrote: >> Make use of the swap macro and remove some unnecessary variables. >> This makes the code easier to read and maintain. Also, reduces the >> st

[PATCH v2] xfs_bmap_util: use swap macro

2018-07-09 Thread Gustavo A. R. Silva
Make use of the swap macro and remove some unnecessary variables. This makes the code easier to read and maintain. Also, reduces the stack usage. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- Changes in v2 - Use swap in a couple more of places. fs

[PATCH] vfio: Mark expected switch fall-throughs

2018-07-09 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/vfio/pci/vfio_pci.c | 2 +- drivers/vfio/vfio_iommu_type1.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a

[PATCH] mtd: nuc900_nand: mark expected switch fall-through

2018-07-10 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1471717 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva --- drivers/mtd/nand/raw/nuc900_nand.c | 3 ++- 1 file changed, 2 insertions(+),

[PATCH] net: sched: act_ife: fix memory leak

2018-07-10 Thread Gustavo A. R. Silva
In case memory resources for *p* are allocated, release them before return. Addresses-Coverity-ID: 1471714 ("Resource leak") Fixes: 0190c1d452a9 ("net: sched: atomically check-allocate action") Signed-off-by: Gustavo A. R. Silva --- net/sched/act_ife.c | 4 +++- 1 file c

Re: [PATCH v2 01/11] crypto: xcbc: Remove VLA usage

2018-06-25 Thread Gustavo A. R. Silva
On 06/25/2018 06:06 PM, Kees Cook wrote: > On Mon, Jun 25, 2018 at 2:23 PM, Joe Perches wrote: >> warning-3 += -Wswitch-default > > This reminds me, though. Should _this_ one get moved to warning-1? > > $ git log next-20180625 --no-merges --grep 'mark expected switch > fall-through' --onelin

Re: [PATCH v2 01/11] crypto: xcbc: Remove VLA usage

2018-06-26 Thread Gustavo A. R. Silva
On 06/26/2018 11:50 AM, Kees Cook wrote: > On Mon, Jun 25, 2018 at 5:54 PM, Gustavo A. R. Silva > wrote: >> >> >> On 06/25/2018 06:06 PM, Kees Cook wrote: >>> On Mon, Jun 25, 2018 at 2:23 PM, Joe Perches wrote: >>>> warning-3 += -Wswitch-default &

[PATCH] rtlwifi: remove duplicate code

2018-05-24 Thread Gustavo A. R. Silva
Remove and refactor some code in order to avoid having identical code for different branches. Notice that the logic has been there since 2014. Addresses-Coverity-ID: 1426199 ("Identical code for different branches") Signed-off-by: Gustavo A. R. Silva --- .../realtek/rtlwifi

Re: [PATCH] rtlwifi: remove duplicate code

2018-05-24 Thread Gustavo A. R. Silva
Hi Joe, On 05/24/2018 02:24 PM, Joe Perches wrote: On Thu, 2018-05-24 at 13:54 -0500, Gustavo A. R. Silva wrote: Remove and refactor some code in order to avoid having identical code for different branches. True and nice tool and patch submittal thanks. Notice that the logic has been there

[PATCH] ath10k: htt_tx: mark expected switch fall-throughs

2018-05-24 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 "pass through" with a proper "fall through" comment, which is what GCC is expecting to find. Signed-off-by:

[PATCH] ath5k: mark expected switch fall-through

2018-05-24 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath5k/pcu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net

[PATCH] ath6kl: mark expected switch fall-throughs

2018-05-24 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath6kl/cfg80211.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath

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

2018-05-25 Thread Gustavo A. R. Silva
On 05/25/2018 08:30 AM, Kalle Valo wrote: Sergei Shtylyov writes: On 5/25/2018 2:13 AM, Gustavo A. R. Silva wrote: In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless

Re: [PATCH] kernel: sys: fix potential Spectre v1

2018-05-25 Thread Gustavo A. R. Silva
On 05/23/2018 11:31 AM, Mark Rutland wrote: On Wed, May 23, 2018 at 04:07:37PM +0100, Mark Rutland wrote: I think that either way, we have a potential problem if the compiler generates a branch dependent on the result of validate_index_nospec(). In that case, we could end up with codegen appr

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

2018-05-25 Thread Gustavo A. R. Silva
On 05/25/2018 01:10 PM, Kalle Valo wrote: Yeah, I was wondering the same. Was there a particular reason for this? Sometimes people use this style for a one-line code block. I can change it to the traditional style. No problem. I would prefer that. So if you can send v2 that would be great

[PATCH v2] ath6kl: mark expected switch fall-throughs

2018-05-25 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Place code comments on a line of their own. drivers/net/wireless/ath/ath6kl/cfg80211.c | 3 +++ 1 file changed, 3 insertions

Re: [PATCH v2] ath6kl: mark expected switch fall-throughs

2018-05-25 Thread Gustavo A. R. Silva
On 05/25/2018 01:27 PM, Steve deRosier wrote: On Fri, May 25, 2018 at 11:23 AM Gustavo A. R. Silva wrote: In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Place code

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