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
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
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
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
#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
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
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
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_
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
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
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
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
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
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
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
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
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
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
-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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
] 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
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
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
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
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
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
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
: 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
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
: 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
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
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
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
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
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
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
_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
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
-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
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
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
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
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
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
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
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
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
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
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
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
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
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.
>>
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
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
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
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
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
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
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
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
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(+),
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
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
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
&
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
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
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:
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
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
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
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
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
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
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
401 - 500 of 3578 matches
Mail list logo