[PATCH] ov13858: Use false for boolean value

2018-01-23 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/media/i2c/ov13858.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov13858.c b

[PATCH] drivers/macintosh: Use true for boolean value

2018-01-23 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/macintosh/windfarm_pm72.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/macintosh

[PATCH] staging: imx-media-vdic: fix inconsistent IS_ERR and PTR_ERR

2018-01-23 Thread Gustavo A. R. Silva
Fix inconsistent IS_ERR and PTR_ERR in vdic_get_ipu_resources. The proper pointer to be passed as argument is ch. This issue was detected with the help of Coccinelle. Fixes: 0b2e9e7947e7 ("media: staging/imx: remove confusing IS_ERR_OR_NULL usage") Signed-off-by: Gustavo A

Re: [PATCH] drivers/macintosh: Use true for boolean value

2018-01-23 Thread Gustavo A. R. Silva
Quoting Michael Ellerman : "Gustavo A. R. Silva" writes: 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/macintosh/windfarm_pm72.c | 2 +- 1 file

[PATCH] macintosh/ams-input: Use true and false for boolean values

2018-01-23 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/macintosh/ams/ams-input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/macintosh/ams/ams

[PATCH] macintosh: change some data types from int to bool

2018-01-23 Thread Gustavo A. R. Silva
Change the data type of the following variables from int to bool across all macintosh drivers: started slots_started pm121_started wf_smu_started Some of these issues were detected with the help of Coccinelle. Suggested-by: Michael Ellerman Signed-off-by: Gustavo A. R. Silva --- drivers

Re: [PATCH] drivers/macintosh: Use true for boolean value

2018-01-23 Thread Gustavo A. R. Silva
Quoting "Gustavo A. R. Silva" : Quoting Michael Ellerman : "Gustavo A. R. Silva" writes: 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/macin

Re: [PATCH] drm/etnaviv: fix '%x' warning

2018-01-24 Thread Gustavo A. R. Silva
Hello Lucas, Quoting Lucas Stach : Hi Gustavo, Am Dienstag, den 23.01.2018, 11:07 -0600 schrieb Gustavo A. R. Silva: Fix the following warning by using %zx instead of %x for variable of type size_t: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type

Re: [PATCH] staging: imx-media-vdic: fix inconsistent IS_ERR and PTR_ERR

2018-01-25 Thread Gustavo A. R. Silva
Quoting Arnd Bergmann : On Wed, Jan 24, 2018 at 1:43 AM, Gustavo A. R. Silva wrote: Fix inconsistent IS_ERR and PTR_ERR in vdic_get_ipu_resources. The proper pointer to be passed as argument is ch. This issue was detected with the help of Coccinelle. Fixes: 0b2e9e7947e7 ("media: st

Re: [Xen-devel] [block-xen-blkback] question about pontential null pointer dereference

2017-05-11 Thread Gustavo A. R. Silva
Hi Juergen, Quoting Juergen Gross : On 10/05/17 18:49, Gustavo A. R. Silva wrote: Hello everybody, While looking into Coverity ID 1350942 I ran into the following piece of code at drivers/block/xen-blkback/xenbus.c:490: 490static int xen_blkbk_remove(struct xenbus_device *dev) 491{ 492

[PATCH] block: xen-blkback: add null check to avoid null pointer dereference

2017-05-11 Thread Gustavo A. R. Silva
Add null check before calling xen_blkif_put() to avoid potential null pointer dereference. Addresses-Coverity-ID: 1350942 Cc: Juergen Gross Signed-off-by: Gustavo A. R. Silva --- drivers/block/xen-blkback/xenbus.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a

[kernel-locking] question about structure field initialization

2017-05-11 Thread Gustavo A. R. Silva
if at all? I'm trying to figure out if this is a false positive or something that needs to be fixed. I'd really appreciate any comment on this. Thank you! -- Gustavo A. R. Silva

[net-dsa-mv88e6xxx] question about potential use of uninitialized variable

2017-05-11 Thread Gustavo A. R. Silva
_? I'm trying to figure out if this is a false positive or something that needs to be fixed. I'd really appreciate any comment on this. Thank you! -- Gustavo A. R. Silva

[PATCH] scsi: libfc: fix incorrect variable assingment

2017-05-11 Thread Gustavo A. R. Silva
Previous assignment was causing the use of the uninitialized variable _explan_ inside fc_seq_ls_rjt() function, which in this particular case is being called by fc_seq_els_rsp_send(). Addresses-Coverity-ID: 1398125 Signed-off-by: Gustavo A. R. Silva --- drivers/scsi/libfc/fc_rport.c | 2 +- 1

Re: [net-dsa-mv88e6xxx] question about potential use of uninitialized variable

2017-05-11 Thread Gustavo A. R. Silva
Hi Andrew, Quoting Andrew Lunn : On Thu, May 11, 2017 at 04:35:37PM -0500, Gustavo A. R. Silva wrote: Hello everybody, While looking into Coverity ID 1398130 I ran into the following piece of code at drivers/net/dsa/mv88e6xxx/chip.c:849: 849static uint64_t _mv88e6xxx_get_ethtool_stat

[PATCH] net: dsa: mv88e6xxx: add default case to switch

2017-05-11 Thread Gustavo A. R. Silva
Add default case to switch in order to avoid any chance of using an uninitialized variable _low_, in case s->type does not match any of the listed case values. Addresses-Coverity-ID: 1398130 Suggested-by: Andrew Lunn Signed-off-by: Gustavo A. R. Silva --- drivers/net/dsa/mv88e6xxx/chip.c

[PATCH] drm/amdkfd: Fix potential NULL pointer dereferences

2018-01-10 Thread Gustavo A. R. Silva
value") Addresses-Coverity-ID: 1463772 ("Dereference null return value") Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd

Re: [PATCH] drm/amdkfd: Fix potential NULL pointer dereferences

2018-01-10 Thread Gustavo A. R. Silva
)) { + mutex_unlock(&p->mutex); + continue; + } + if (pdd->bound == PDD_BOUND) pdd->bound = PDD_BOUND_SUSPENDED; mutex_unlock(&p->mutex); Thank you for the feedback. -- Gustavo

[PATCH v2] drm/amdkfd: Fix potential NULL pointer dereferences

2018-01-10 Thread Gustavo A. R. Silva
ty-ID: 1463794 ("Dereference null return value") Addresses-Coverity-ID: 1463772 ("Dereference null return value") Suggested-by: Felix Kuehling Signed-off-by: Gustavo A. R. Silva --- Changes in v2: Print a WARN_ON and skip PDDs that aren't found instead of returning an error

Re: [PATCH v2] drm/amdkfd: Fix potential NULL pointer dereferences

2018-01-11 Thread Gustavo A. R. Silva
Quoting Oded Gabbay : On Thu, Jan 11, 2018 at 1:15 AM, Gustavo A. R. Silva wrote: In case kfd_get_process_device_data returns null, there are some null pointer dereferences in functions kfd_bind_processes_to_device and kfd_unbind_processes_from_device. Fix this by printing a WARN_ON for

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Gustavo A. R. Silva
Hi Hans, Quoting Hans Verkuil : Hi Gustavo, On 01/30/2018 01:33 AM, Gustavo A. R. Silva wrote: Cast len to const u64 in order to avoid a potential integer overflow. This variable is being used in a context that expects an expression of type const u64. Addresses-Coverity-ID: 1454996

Re: [PATCH] drm/edid: use false for boolean value

2018-01-30 Thread Gustavo A. R. Silva
Hi Daniel, Quoting Daniel Vetter : On Tue, Jan 23, 2018 at 10:46:07AM -0600, 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 Thanks for your patch

[PATCH v2] drm/edid: use true and false for boolean values

2018-01-30 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 --- Changes in v2: - Use true for boolean value in add_detailed_mode as suggested by Daniel Vetter. - Update subject. drivers/gpu

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Gustavo A. R. Silva
Quoting Hans Verkuil : On 01/30/2018 09:51 AM, Gustavo A. R. Silva wrote: Hi Hans, Quoting Hans Verkuil : Hi Gustavo, On 01/30/2018 01:33 AM, Gustavo A. R. Silva wrote: Cast len to const u64 in order to avoid a potential integer overflow. This variable is being used in a context that

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Gustavo A. R. Silva
Quoting Hans Verkuil : [...] What happens if you do: ((u64)CEC_TIM_START_BIT_TOTAL + I think that forces everything else in the expression to be evaluated as u64. Well, in this case the operator precedence takes place and the expression len * 10 * CEC_TIM_DATA_BIT_TOTAL is computed first.

Re: [PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-30 Thread Gustavo A. R. Silva
Quoting Hans Verkuil : On 01/30/18 12:43, Gustavo A. R. Silva wrote: Quoting Hans Verkuil : [...] What happens if you do: ((u64)CEC_TIM_START_BIT_TOTAL + I think that forces everything else in the expression to be evaluated as u64. Well, in this case the operator precedence takes

[PATCH] tcp_nv: fix potential integer overflow in tcpnv_acked

2018-01-30 Thread Gustavo A. R. Silva
external cast to u64. Addresses-Coverity-ID: 1357588 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva --- net/ipv4/tcp_nv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_nv.c b/net/ipv4/tcp_nv.c index ddbce73..764298e 100644 --- a/net/ipv

[PATCH] openvswitch: meter: Use 64-bit arithmetic instead of 32-bit

2018-01-30 Thread Gustavo A. R. Silva
000 is currently being evaluated using 32-bit arithmetic. Addresses-Coverity-ID: 1461563 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva --- net/openvswitch/meter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/openvswitch/meter.c b/net/openvswit

[PATCH] libceph: use 64-bit arithmetic instead of 32-bit

2018-01-30 Thread Gustavo A. R. Silva
arithmetic. In general, the use of incorrect arithmetic has security implications. Addresses-Coverity-ID: 200686 Signed-off-by: Gustavo A. R. Silva --- net/ceph/osdmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index 0da27c6

Re: [PATCH] libceph: use 64-bit arithmetic instead of 32-bit

2018-01-31 Thread Gustavo A. R. Silva
Hello Ilya, Quoting Ilya Dryomov : On Wed, Jan 31, 2018 at 6:29 AM, Gustavo A. R. Silva wrote: Cast objsetno to u64 in order to give the compiler complete information about the proper arithmetic to use. Notice that this variable is used in a context that expects an expression of type u64 (64

[PATCH] tcp_lp: use 64-bit arithmetic instead of 32-bit

2018-01-31 Thread Gustavo A. R. Silva
arithmetic. Addresses-Coverity-ID: 200687 Addresses-Coverity-ID: 200688 Addresses-Coverity-ID: 200689 Signed-off-by: Gustavo A. R. Silva --- net/ipv4/tcp_lp.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/ipv4/tcp_lp.c b/net/ipv4/tcp_lp.c index ae10ed6..4999111 100644

Re: [PATCH] tcp_lp: use 64-bit arithmetic instead of 32-bit

2018-01-31 Thread Gustavo A. R. Silva
Hi Alan, Quoting Alan Cox : On Wed, 31 Jan 2018 18:24:07 -0600 "Gustavo A. R. Silva" wrote: Cast to s64 some variables and a macro in order to give the compiler complete information about the proper arithmetic to use. Notice that these elements are used in contexts that expect e

[PATCH] usb: gadget: compress return logic into one line

2018-01-18 Thread Gustavo A. R. Silva
Simplify return logic and avoid unnecessary variable assignment. Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/legacy/ncm.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/legacy/ncm.c b/drivers/usb/gadget/legacy/ncm.c index fcee1ee0

[PATCH] netfilter: return booleans instead of integers

2018-01-18 Thread Gustavo A. R. Silva
Return statements in functions returning bool should use true/false instead of 1/0. These issues were detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- net/netfilter/nf_conncount.c | 2 +- net/netfilter/xt_hashlimit.c | 2 +- net/netfilter/xt_ipcomp.c| 2 +- 3

[PATCH] bridge: return boolean instead of integer in br_multicast_is_router

2018-01-18 Thread Gustavo A. R. Silva
Return statements in functions returning bool should use true/false instead of 1/0. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- net/bridge/br_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bridge/br_private.h b

[PATCH] ssb: return boolean instead of integer in ssb_dma_translation_special_bit

2018-01-18 Thread Gustavo A. R. Silva
Return statements in functions returning bool should use true/false instead of 1/0. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/ssb/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ssb/main.c b/drivers

[PATCH] smc: return boolean instead of integer in using_ipsec

2018-01-18 Thread Gustavo A. R. Silva
Return statements in functions returning bool should use true/false instead of 1/0. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- net/smc/smc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/smc/smc.h b/net/smc/smc.h index

[PATCH] drm/vmwgfx: Return boolean instead of integer in vmw_fence_obj_signaled

2018-01-18 Thread Gustavo A. R. Silva
Return statements in functions returning bool should use true/false instead of 1/0. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu

[PATCH] drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry

2018-01-18 Thread Gustavo A. R. Silva
Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd

Re: [PATCH] bridge: return boolean instead of integer in br_multicast_is_router

2018-01-18 Thread Gustavo A. R. Silva
Quoting Stephen Hemminger : On Thu, 18 Jan 2018 17:37:45 -0600 "Gustavo A. R. Silva" wrote: Return statements in functions returning bool should use true/false instead of 1/0. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva L

Re: [PATCH] smc: return boolean instead of integer in using_ipsec

2018-01-19 Thread Gustavo A. R. Silva
Hi Ursula, Quoting Ursula Braun : On 01/19/2018 12:33 AM, Gustavo A. R. Silva wrote: Return statements in functions returning bool should use true/false instead of 1/0. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- net/smc/smc.h | 2 +- 1 file

[PATCH v2] smc: return booleans instead of integers

2018-01-19 Thread Gustavo A. R. Silva
Return statements in functions returning bool should use true/false instead of 1/0. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Fix function using_ipsec as suggested by Ursula Braun. - Update subject line. net/smc/smc.h | 4

Re: [PATCH] drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry

2018-01-19 Thread Gustavo A. R. Silva
Quoting Felix Kuehling : Looks good. This change is Reviewed-by: Felix Kuehling Thanks Felix. -- Gustavo

[PATCH] PCI: altera: Fix bool initialization in tlp_read_packet

2018-01-19 Thread Gustavo A. R. Silva
Bool initializations should use true and false. This issue was detected with the help of Coccinelle. Fixes: eaa6111b70a7 ("PCI: altera: Add Altera PCIe host controller driver") Signed-off-by: Gustavo A. R. Silva --- drivers/pci/host/pcie-altera.c | 2 +- 1 file changed, 1 inser

[PATCH] power: supply: da9030_battery: fix boolean value assignment in da9030_set_charge

2018-01-19 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. Fixes: 342d765e011f ("power_supply: Add Dialog DA9030 battery charger driver") Signed-off-by: Gustavo A. R. Silva --- drivers/power/supply/da9030_battery.c |

[PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na

2018-01-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. Fixes: 1cb3fe513f62 ("ndisc: Break down ndisc_build_skb() and build message directly.") Signed-off-by: Gustavo A. R. Silva --- net/ipv6/ndisc.c | 2 +- 1 file

[PATCH] tipc: bcast: fix boolean assignment in tipc_nlist_purge

2018-01-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. Fixes: 2ae0b8af1fe3 ("tipc: add functionality to lookup multicast destination nodes") Signed-off-by: Gustavo A. R. Silva --- net/tipc/bcast.c | 2 +- 1 file

[PATCH] net: caif: fix boolean assignments

2018-01-22 Thread Gustavo A. R. Silva
l it later") Signed-off-by: Gustavo A. R. Silva --- net/caif/caif_dev.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c index e0adcd1..f2848d6 100644 --- a/net/caif/caif_dev.c +++ b/net/caif/caif_dev.c @@ -139,7 +139,7 @@

[PATCH] xfrm: fix boolean assignment in xfrm_get_type_offload

2018-01-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. Fixes: ffdb5211da1c ("xfrm: Auto-load xfrm offload modules") Signed-off-by: Gustavo A. R. Silva --- net/xfrm/xfrm_state.c | 2 +- 1 file changed, 1 inser

Re: [PATCH v2] smc: return booleans instead of integers

2018-01-22 Thread Gustavo A. R. Silva
Quoting Ursula Braun : [...] Thanks, Gustavo. I have added the patch to our local repository. It will be part of one of my next patch sets to be sent to Dave Miller. Thanks, Ursula :) -- Gustavo

[PATCH] phylink: mark expected switch fall-throughs in phylink_mii_ioctl

2018-01-05 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1463447 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva --- This code was compiled with GCC 7.2.0 drivers/net/phy/phylink.c | 2 ++ 1 fi

Re: macintosh: change some data types from int to bool

2018-01-29 Thread Gustavo A. R. Silva
Hi Michael, Quoting Michael Ellerman : On Wed, 2018-01-24 at 01:42:28 UTC, "Gustavo A. R. Silva" wrote: Change the data type of the following variables from int to bool across all macintosh drivers: started slots_started pm121_started wf_smu_started Some of these issues were det

[PATCH 3/8] i2c: max2175: fix potential integer overflow in max2175_set_nco_freq

2018-01-29 Thread Gustavo A. R. Silva
Cast expression (clock_rate - abs_nco_freq) to s64 in order to avoid a potential integer overflow. This variable is being used in a context that expects an expression of type s64. Addresses-Coverity-ID: 1446589 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva --

[PATCH 6/8] rockchip/rga: fix potential integer overflow in rga_buf_map

2018-01-29 Thread Gustavo A. R. Silva
Cast p to dma_addr_t in order to avoid a potential integer overflow. This variable is being used in a context that expects an expression of type dma_addr_t (u64). Addresses-Coverity-ID: 1458347 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva --- drivers/medi

[PATCH 7/8] platform: sh_veu: fix potential integer overflow in sh_veu_colour_offset

2018-01-29 Thread Gustavo A. R. Silva
ntional integer overflow") Signed-off-by: Gustavo A. R. Silva --- drivers/media/platform/sh_veu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c index 976ea0b..e2795d0 100644 --- a/drivers/media/pla

[PATCH 1/8] rtl2832: fix potential integer overflow in rtl2832_set_frontend

2018-01-29 Thread Gustavo A. R. Silva
Cast dev->pdata->clk to u64 in order to avoid a potential integer overflow. This variable is being used in a context that expects an expression of type u64. Addresses-Coverity-ID: 1271223 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva --- drivers/med

[PATCH 4/8] i2c: ov9650: fix potential integer overflow in __ov965x_set_frame_interval

2018-01-29 Thread Gustavo A. R. Silva
Cast fi->interval.numerator to u64 in order to avoid a potential integer overflow. This variable is being used in a context that expects an expression of type u64. Addresses-Coverity-ID: 1324146 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva --- drivers/media

[PATCH 2/8] dvb-frontends: ves1820: fix potential integer overflow

2018-01-29 Thread Gustavo A. R. Silva
Cast state->config->xin to u64 in order to avoid a potential integer overflow. This variable is being used in a context that expects an expression of type u64. Addresses-Coverity-ID: 200604 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva --- drivers/med

[PATCH 5/8] pci: cx88-input: fix potential integer overflow

2018-01-29 Thread Gustavo A. R. Silva
l integer overflow") Signed-off-by: Gustavo A. R. Silva --- drivers/media/pci/cx88/cx88-input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c index 4e9953e..096b350 100644 --- a/drivers/medi

[PATCH 8/8] platform: vivid-cec: fix potential integer overflow in vivid_cec_pin_adap_events

2018-01-29 Thread Gustavo A. R. Silva
Cast len to const u64 in order to avoid a potential integer overflow. This variable is being used in a context that expects an expression of type const u64. Addresses-Coverity-ID: 1454996 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva --- drivers/media/plat

[PATCH resend 0/8] fix potential integer overflows

2018-01-29 Thread Gustavo A. R. Silva
s the following Coverity IDs reported as "Unintentional integer overflow" issues: 200604, 1056807, 1056808, 1271223, 1324146, 1392628, 1392630, 1446589, 1454996, 1458347. Thank you Gustavo A. R. Silva (8): rtl2832: fix potential integer overflow dvb-frontends: ves1820: fix potential i

Re: [PATCH] soc: xilinx: xlnx_vcu: Use bitwise & rather than logical && on clkoutdiv

2018-01-16 Thread Gustavo A. R. Silva
Quoting Michal Simek : On 16.1.2018 15:22, Dhaval Rajeshbhai Shah wrote: Hi, -Original Message- From: Gustavo A. R. Silva [mailto:garsi...@embeddedor.com] Sent: Monday, January 15, 2018 11:15 AM To: Michal Simek ; Dhaval Rajeshbhai Shah Cc: linux-arm-ker...@lists.infradead.org

[PATCH] soc: xilinx: xlnx_vcu: Use bitwise & rather than logical && on clkoutdiv

2018-01-15 Thread Gustavo A. R. Silva
_vcu: Add Xilinx ZYNQMP VCU logicoreIP init driver") Signed-off-by: Gustavo A. R. Silva --- drivers/soc/xilinx/xlnx_vcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/xilinx/xlnx_vcu.c b/drivers/soc/xilinx/xlnx_vcu.c index c1d6f1b..a840c02 100644 --- a/dri

[PATCH] Input: stmpe-keypad - remove VLA usage

2018-03-09 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 --- drivers/input/keyboard/stmpe-keypad.c | 10 ++ 1

[PATCH] EDAC, sb_edac: Remove VLA usage

2018-03-09 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 --- Notice that due to this change, the field max_interleave

Re: [PATCH] Input: stmpe-keypad - remove VLA usage

2018-03-09 Thread Gustavo A. R. Silva
Hi Dmitry, On 03/09/2018 05:32 PM, Dmitry Torokhov wrote: On Fri, Mar 09, 2018 at 04:42:08PM -0600, Gustavo A. R. Silva wrote: 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

[PATCH v2] Input: stmpe-keypad - remove VLA usage

2018-03-09 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: - Update the code based on Dmitry Torokhov

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

2018-03-09 Thread Gustavo A. R. Silva
Hi Krzysztof, On 03/09/2018 07:04 AM, Krzysztof Kozlowski wrote: On Thu, Mar 8, 2018 at 7:03 PM, Gustavo A. R. Silva wrote: 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

[PATCH 1/2] rtc: s5m: Move enum from rtc.h to rtc-s5m.c

2018-03-09 Thread Gustavo A. R. Silva
Move this enum to rtc-s5m.c once it is meaningless to others drivers [1]. [1] https://marc.info/?l=linux-rtc&m=152060068925948&w=2 Signed-off-by: Gustavo A. R. Silva --- drivers/rtc/rtc-s5m.c | 11 +++ include/linux/mfd/samsung/rtc.h | 11 --- 2 files cha

[PATCH 0/2] Remove VLA usage in rtc-s5m

2018-03-09 Thread Gustavo A. R. Silva
VLAs, hence turning them into fixed-length arrays instead. [1] https://marc.info/?l=linux-rtc&m=152060068925948&w=2 Thanks Gustavo A. R. Silva (2): rtc: s5m: move enum from rtc.h to rtc-s5m.c rtc: s5m: Remove VLA usage drivers/rtc/rtc-s5m.c | 25 +++--

[PATCH 2/2] rtc: s5m: Remove VLA usage

2018-03-09 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 | 14 -- 1 file changed, 8 insertions(+), 6 deleti

Re: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage

2018-03-10 Thread Gustavo A. R. Silva
On 03/10/2018 05:12 PM, Kees Cook wrote: On Sat, Mar 10, 2018 at 3:06 PM, Arend van Spriel wrote: On 3/9/2018 1:30 PM, Andreas Christoforou wrote: The kernel would like to have all stack VLA usage removed. I think there was a remark made earlier to give more explanation here. It should e

Re: [RFC] netfilter: cttimeout: remove VLA in ctnl_timeout_parse_policy

2018-03-11 Thread Gustavo A. R. Silva
Hi Pablo, On 03/11/2018 05:04 PM, Pablo Neira Ayuso wrote: On Tue, Mar 06, 2018 at 12:47:55PM -0600, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA and replace it with dynamic memory allocation. Looks good but... Signed-off-by: Gustavo A. R. Silva --- net

Re: [RFC] netfilter: cttimeout: remove VLA in ctnl_timeout_parse_policy

2018-03-11 Thread Gustavo A. R. Silva
On 03/11/2018 05:21 PM, Pablo Neira Ayuso wrote: On Sun, Mar 11, 2018 at 05:12:09PM -0500, Gustavo A. R. Silva wrote: Hi Pablo, On 03/11/2018 05:04 PM, Pablo Neira Ayuso wrote: On Tue, Mar 06, 2018 at 12:47:55PM -0600, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA

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

2018-03-12 Thread Gustavo A. R. Silva
Hi Borislav, On 03/10/2018 08:04 AM, Borislav Petkov wrote: On Fri, Mar 09, 2018 at 09:02:18PM -0600, Gustavo A. R. Silva wrote: 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

[PATCH] netfilter: cttimeout: remove VLA usage

2018-03-12 Thread Gustavo A. R. Silva
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 --- net/netfilter/nfnetlink_cttimeout.c | 26 +- 1 file changed, 17 inserti

[PATCH] netfilter: nfnetlink_cthelper: Remove VLA usage

2018-03-12 Thread Gustavo A. R. Silva
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 --- net/netfilter/nfnetlink_cthelper.c | 25 + 1 file changed, 17 inserti

[PATCH] netfilter: nf_tables: remove VLA usage

2018-03-12 Thread Gustavo A. R. Silva
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 --- net/netfilter/nf_tables_api.c | 23 +++ 1 file changed, 15 insertions(+)

Re: [PATCH 0/2] Remove VLA usage in rtc-s5m

2018-03-12 Thread Gustavo A. R. Silva
On 03/12/2018 07:35 PM, Alexandre Belloni wrote: Hi, On 10/03/2018 at 00:27:02 -0600, Gustavo A. R. Silva wrote: This patchset aims to remove VLA usage from rtc-s5m. The first patch moves an enum from rtc.h to rtc-s5m.c, as this is the only driver in which such enum is actually being used

[PATCH v2] netfilter: nf_tables: remove VLA usage

2018-03-12 Thread Gustavo A. R. Silva
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: - Use kmalloc_array instead of kcalloc. net/netfilter/nf_tables_api.c |

Re: [PATCH 1/2] rtc: s5m: Move enum from rtc.h to rtc-s5m.c

2018-03-12 Thread Gustavo A. R. Silva
On 03/11/2018 11:39 AM, Krzysztof Kozlowski wrote: On Sat, Mar 10, 2018 at 7:27 AM, Gustavo A. R. Silva wrote: Move this enum to rtc-s5m.c once it is meaningless to others drivers [1]. [1] https://marc.info/?l=linux-rtc&m=152060068925948&w=2 Instead of external link (which might

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

2018-03-12 Thread Gustavo A. R. Silva
On 03/09/2018 05:02 AM, Emil Velikov wrote: On 9 March 2018 at 10:59, Eric Engestrom wrote: On Thursday, 2018-03-08 11:39:49 -0600, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA usage. Also, fixed as part of the directive to remove all VLAs from the kernel: https

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

2018-03-05 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 --- net/xfrm/xfrm_policy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm

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

2018-03-05 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 --- net/netfilter/ipvs/ip_vs_lblc.c | 4 ++-- net/netfilter/ipvs/ip_vs_lblcr.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions

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

2018-03-05 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 --- net/caif/caif_dev.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/caif/caif_dev.c b/net/caif

[PATCH] ipv6: ndisc: use true and false for boolean values

2018-03-05 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 --- net/ipv6/ndisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index

Re: [PATCH] netfilter: ipt_ah: return boolean instead of integer

2018-03-05 Thread Gustavo A. R. Silva
On 03/05/2018 04:10 PM, Pablo Neira Ayuso wrote: On Tue, Feb 13, 2018 at 08:25:57AM -0600, Gustavo A. R. Silva wrote: Return statements in functions returning bool should use true/false instead of 1/0. This issue was detected with the help of Coccinelle. This one didn't get in time fo

[PATCH] tipc: bcast: use true and false for boolean values

2018-03-05 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 --- net/tipc/bcast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index

[PATCH] RDMA/bnxt_re/qplib_sp: Use true and false for boolean values

2018-03-05 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/infiniband/hw/bnxt_re/qplib_sp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw

[PATCH] spi: tegra20-slink: use true and false for boolean values

2018-03-05 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/spi/spi-tegra20-slink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-tegra20

[PATCH] HID: hid-ntrig: use true and false for boolean values

2018-03-05 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/hid/hid-ntrig.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/hid/hid-ntrig.c b

[PATCH] HID: hid-multitouch: Use true and false for boolean values

2018-03-05 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/hid/hid-multitouch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-multitouch.c b

[PATCH] Input: appletouch - use true and false for boolean values

2018-03-05 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/input/mouse/appletouch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/mouse

[PATCH] pinctrl: mediatek: mtk-common: use true and false for boolean values

2018-03-05 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/pinctrl/mediatek/pinctrl-mtk-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH] cxgb3: remove VLA

2018-03-05 Thread Gustavo A. R. Silva
In preparation to enabling -Wvla, remove VLA and replace it with dynamic memory allocation. Signed-off-by: Gustavo A. R. Silva --- drivers/net/ethernet/chelsio/cxgb3/t3_hw.c | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet

Re: [PATCH] HID: hid-ntrig: use true and false for boolean values

2018-03-06 Thread Gustavo A. R. Silva
Hi Jiri, On 03/06/2018 08:20 AM, Jiri Kosina wrote: On Mon, 5 Mar 2018, 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 I've commited this (an

[RFC] netfilter: cttimeout: remove VLA in ctnl_timeout_parse_policy

2018-03-06 Thread Gustavo A. R. Silva
In preparation to enabling -Wvla, remove VLA and replace it with dynamic memory allocation. Signed-off-by: Gustavo A. R. Silva --- net/netfilter/nfnetlink_cttimeout.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/net/netfilter/nfnetlink_cttimeout.c b/net

Re: [PATCH] cxgb3: remove VLA

2018-03-07 Thread Gustavo A. R. Silva
On 03/07/2018 11:25 AM, David Miller wrote: From: "Gustavo A. R. Silva" Date: Mon, 5 Mar 2018 23:39:34 -0600 In preparation to enabling -Wvla, remove VLA and replace it with dynamic memory allocation. Signed-off-by: Gustavo A. R. Silva All of these lengths are limited by the e

[PATCH v2] cxgb3: remove VLA usage

2018-03-07 Thread Gustavo A. R. Silva
Remove VLA usage and change the 'len' argument to a u8 and use a 256 byte buffer on the stack. Notice that these lengths are limited by the encoding field in the VPD structure, which is a u8 [1]. [1] https://marc.info/?l=linux-netdev&m=152044354814024&w=2 Signed-off-by: G

[PATCH] video: fbdev: via_aux_vt1632: 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_vt1632.c | 6 +++--- 1 file

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