[PATCH] drivers: usb-misc: sisusbvga: remove dead code

2017-02-07 Thread Gustavo A. R. Silva
The condition modex % 16 cannot be true when modex value is equal to 640 The condition du & 0xff cannot be true when du value is equal to 0x1400 Addresses-Coverity-Id: 101163 Addresses-Coverity-Id: 744373 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/misc/sisusbvga/sisusb.c | 6 -

[PATCH] drivers: usb: early: remove unused code

2017-02-07 Thread Gustavo A. R. Silva
Remove this line of code because devnum is overwritten before it can be used. This could happen if line of code 609 (goto try_again;) is executed. Otherwise, devnum is never used again. Addresses-Coverity-ID: 1226870 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/early/ehci-dbgp.c | 1 - 1

[PATCH 1/2] drivers: usb: gadget: udc: add missing break in switch

2017-02-07 Thread Gustavo A. R. Silva
Add missing break in switch. Addresses-Coverity-ID: 201385 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/udc/mv_udc_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/mv_udc_core.c index 27ebb0d..56b3574 100644

[PATCH 2/2] drivers: usb: gadget: udc: remove logically dead code

2017-02-07 Thread Gustavo A. R. Silva
Remove unnecesary code because zlt never evaluates to zero. Addresses-Coverity-ID: 1226747 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/udc/mv_udc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget

Re: [PATCH 1/2] drivers: usb: gadget: udc: add missing break in switch

2017-02-08 Thread Gustavo A. R. Silva
Hello Felipe, Quoting Felipe Balbi : Hi, "Gustavo A. R. Silva" writes: Add missing break in switch. Addresses-Coverity-ID: 201385 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/udc/mv_udc_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/

[PATCH] drivers: usb: gadget: udc: remove pointer dereference after free

2017-02-08 Thread Gustavo A. R. Silva
Remove pointer dereference and write after free. Addresses-Coverity-ID: 1091173 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/udc/pch_udc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c index a97da64..8a365aa

Re: [PATCH] drivers: usb: gadget: udc: remove pointer dereference after free

2017-02-08 Thread Gustavo A. R. Silva
Hi Andy, Quoting Andy Shevchenko : On Wed, 2017-02-08 at 13:15 -0600, Gustavo A. R. Silva wrote: Remove pointer dereference and write after free. It's wrong description. There is no write after free. The memory is still in pool and one may access it. Though the access is *formally* il

drivers: usb: dwc3: A question...

2017-02-09 Thread Gustavo A. R. Silva
e case for OMAP_DWC3_ID_FLOAT is not terminated by a break statement, and it falls through to the next case OMAP_DWC3_VBUS_OFF. My question here is if for any reason this code is intentional? In case it is not, I will write a patch to fix this, but first it would be great to hear any co

[PATCH] drivers: usb: usbip: Add missing break statement to switch

2017-02-09 Thread Gustavo A. R. Silva
Add missing break statement to prevent the code for case USB_PORT_FEAT_C_RESET falling through to the default case. Addresses-Coverity-ID: 143155 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/usbip/vhci_hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/usbip/vhci_hcd.c

drivers: usb: musb: question about missing break in switch

2017-02-09 Thread Gustavo A. R. Silva
to the next case MUSB_QUIRK_A_DISCONNECT_19, in case "if (musb->quirk_retries--)" turns to be false. My question here is if this code is intentional? In case it is not, I will write a patch to fix this, but first it would be great to hear any comment about it.

Re: drivers: usb: musb: question about missing break in switch

2017-02-09 Thread Gustavo A. R. Silva
Hello Bin, Quoting Bin Liu : On Thu, Feb 09, 2017 at 02:37:34AM -0600, Gustavo A. R. Silva wrote: Hello everybody, I ran into the following piece of code at drivers/usb/musb/musb_core.c:1854 (linux-next) 1854/* 1855 * Check the musb devctl session bit to determine if we want to 1856 * allow

[PATCH] drivers: usb: musb: add code comment for clarification

2017-02-09 Thread Gustavo A. R. Silva
Add code comment to make it clear that the fall-through is intentional. Read the link for more details: https://lkml.org/lkml/2017/2/9/292 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/musb/musb_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/musb/musb_core.c b

[PATCH] usb: musb: add code comment for clarification

2017-02-10 Thread Gustavo A. R. Silva
Add code comment to make it clear that the fall-through is intentional. Read the link for more details: https://lkml.org/lkml/2017/2/9/292 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/musb/musb_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/musb/musb_core.c b

[PATCH v2] usb: gadget: udc: remove pointer dereference after free

2017-02-11 Thread Gustavo A. R. Silva
Remove pointer dereference after free and set pointer to NULL after free. Addresses-Coverity-ID: 1091173 Signed-off-by: Gustavo A. R. Silva --- Changes in v2: Move pointer dereference before pci_pool_free() Set pointer to NULL after free drivers/usb/gadget/udc/pch_udc.c | 3 ++- 1 file

[PATCH 0/2] avoid use of freed pointer

2017-02-13 Thread Gustavo A. R. Silva
Hello, This patch series addesses Coverity ID 1091172, which reports the use of a freed pointer. udc_free_dma_chain() function was rewritten in order to fix this issue. Unnecessary 'ret_val' variable was removed and the function prototype was modified. Thanks Gustavo A. R. Silva

[PATCH 2/2] usb: gadget: udc: remove unnecessary variable and update function prototype

2017-02-13 Thread Gustavo A. R. Silva
Remove unnecessary variable and update function prototype. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/udc/amd5536udc.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb

[PATCH 1/2] usb: gadget: udc: avoid use of freed pointer

2017-02-13 Thread Gustavo A. R. Silva
Rewrite udc_free_dma_chain() function to avoid use of pointer after free. Addresses-Coverity-ID: 1091172 Reviewed-by: Greg Kroah-Hartman Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/udc/amd5536udc.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff

Re: [PATCH v2] usb: gadget: udc: remove pointer dereference after free

2017-02-13 Thread Gustavo A. R. Silva
Hi Michal, Quoting Michal Nazarewicz : On Sat, Feb 11 2017, Gustavo A. R. Silva wrote: Remove pointer dereference after free and set pointer to NULL after free. Addresses-Coverity-ID: 1091173 Signed-off-by: Gustavo A. R. Silva Acked-by: Michal Nazarewicz --- Changes in v2: Move

[PATCH v3] usb: gadget: udc: remove pointer dereference after free

2017-02-13 Thread Gustavo A. R. Silva
Remove pointer dereference after free. Addresses-Coverity-ID: 1091173 Acked-by: Michal Nazarewicz Signed-off-by: Gustavo A. R. Silva --- Changes in v2: Move pointer dereference before pci_pool_free() Set pointer to NULL after free Changes in v3: Remove 'td->next = 0x00' in

Re: [PATCH] usb: musb: add code comment for clarification

2017-02-14 Thread Gustavo A. R. Silva
Quoting Greg KH : On Fri, Feb 10, 2017 at 06:57:41PM -0600, Gustavo A. R. Silva wrote: Add code comment to make it clear that the fall-through is intentional. Read the link for more details: https://lkml.org/lkml/2017/2/9/292 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/musb

[PATCH v2] usb: musb: add code comment for clarification

2017-02-14 Thread Gustavo A. R. Silva
Add code comment to make it clear that the fall-through is intentional. Read the link for more details: https://lkml.org/lkml/2017/2/9/292 Addresses-Coverity-ID: 1397608 Signed-off-by: Gustavo A. R. Silva --- Changes in v2: Fix tabs and line-wrapping in previous patch. drivers/usb/musb

Re: [PATCH 1/2] usb: gadget: udc: avoid use of freed pointer

2017-02-14 Thread Gustavo A. R. Silva
Hi Michal, Quoting Michal Nazarewicz : On Mon, Feb 13 2017, Gustavo A. R. Silva wrote: Rewrite udc_free_dma_chain() function to avoid use of pointer after free. Addresses-Coverity-ID: 1091172 Reviewed-by: Greg Kroah-Hartman Signed-off-by: Gustavo A. R. Silva Acked-by: Michal Nazarewicz

[PATCH v2 1/2] usb: gadget: udc: avoid use of freed pointer

2017-02-14 Thread Gustavo A. R. Silva
Rewrite udc_free_dma_chain() function to avoid use of pointer after free. Addresses-Coverity-ID: 1091172 Acked-by: Michal Nazarewicz Reviewed-by: Greg Kroah-Hartman Signed-off-by: Gustavo A. R. Silva --- Changes in v2: Remove 'td->next = 0x00' inside for loop. Remove unnece

[PATCH v2 2/2] usb: gadget: udc: remove unnecessary variable and update function prototype

2017-02-14 Thread Gustavo A. R. Silva
Remove unnecessary variable and update function prototype. Acked-by: Michal Nazarewicz Reviewed-by: Greg Kroah-Hartman Signed-off-by: Gustavo A. R. Silva --- Changes in v2: None. drivers/usb/gadget/udc/amd5536udc.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a

[PATCH] usb: class: remove logically dead code

2017-02-14 Thread Gustavo A. R. Silva
Remove logically dead code. 'cntr' is always equal to zero when the following line of code is executed: rv = cntr ? cntr : -EAGAIN; Addresses-Coverity-ID: 113227 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/class/cdc-wdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

usb: storage: suspicious code

2017-02-14 Thread Gustavo A. R. Silva
modified (++waitcount < 10) In case 'waitcount' isn't needed, lines 318 and 319 should be removed. Can someone help me to clarify this so I can write a patch to fix this code? Thank you -- Gustavo A. R. Silva -- To unsubscribe from this list: send the line "unsubscribe linux

Re: [usb-storage] usb: storage: suspicious code

2017-02-14 Thread Gustavo A. R. Silva
Hi Oliver, Quoting Oliver Neukum : Am Dienstag, den 14.02.2017, 23:06 -0600 schrieb Gustavo A. R. Silva: Hi, waitcount = 0; do { result = jumpshot_get_status(us); if (result != USB_STOR_TRANSPORT_GOOD) { // I have not experimented to find the smallest value

[PATCH] usb: storage: add missing pre-increment to variable

2017-02-14 Thread Gustavo A. R. Silva
Add missing pre-increment to 'waitcount' variable used in do-while loop. Addresses-Coverity-ID: 1011631 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/storage/jumpshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/storage/jumpshot.c b/drivers/u

[PATCH] usb: misc: remove unnecessary code

2017-02-16 Thread Gustavo A. R. Silva
'val' is an unsigned variable, and less-than-zero comparison of an unsigned variable is never true. Addresses-Coverity-ID: 1230256 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/misc/lvstest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/misc/l

[PATCH] usb: atm: remove unnecessary code

2017-02-16 Thread Gustavo A. R. Silva
'index' is an unsigned variable, and less-than-zero comparison of an unsigned variable is never true. Addresses-Coverity-ID: 115396 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/atm/cxacru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/atm/

[PATCH] usb: host: add cast to avoid potential integer overflow

2017-02-16 Thread Gustavo A. R. Silva
y: Gustavo A. R. Silva --- drivers/usb/host/xhci.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 50aee8b..8094d9a 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4298,23 +4298,23 @@ stati

[PATCH] usb: misc: remove unnecessary code

2017-02-20 Thread Gustavo A. R. Silva
'val' is an unsigned variable, and less-than-zero comparison of an unsigned variable is never true. Addresses-Coverity-ID: 1230257 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/misc/lvstest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/misc/l

[usb-misc] question about missing break in switch

2017-02-20 Thread Gustavo A. R. Silva
ER_ISOC:" It would be great to hear any comment about this. Thank you -- Gustavo A. R. Silva -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [usb-misc] question about missing break in switch

2017-02-21 Thread Gustavo A. R. Silva
Hi Alan, Quoting Alan Stern : On Mon, 20 Feb 2017, Gustavo A. R. Silva wrote: Hello everybody, I ran into the following piece of code at drivers/usb/misc/usbtest.c:149 (linux-next) 149/* take the first altsetting with in-bulk + out-bulk; 150 * ignore other

[PATCH] usb: misc: add a missing continue and refactor code

2017-02-21 Thread Gustavo A. R. Silva
Code refactoring to make the flow easier to follow and add missing 'continue' for case USB_ENDPOINT_XFER_INT. Addresses-Coverity-ID: 1248733 Cc: Alan Stern Signed-off-by: Gustavo A. R. Silva --- drivers/usb/misc/usbtest.c | 50 +++--- 1 file c

Re: [PATCH] usb: misc: add a missing continue and refactor code

2017-02-21 Thread Gustavo A. R. Silva
Hi Alan, Quoting Alan Stern : On Tue, 21 Feb 2017, Gustavo A. R. Silva wrote: Code refactoring to make the flow easier to follow and add missing 'continue' for case USB_ENDPOINT_XFER_INT. Addresses-Coverity-ID: 1248733 Cc: Alan Stern Signed-off-by: Gustavo A. R. Silva --- d

Re: [PATCH] usb: misc: add a missing continue and refactor code

2017-02-21 Thread Gustavo A. R. Silva
Quoting "Gustavo A. R. Silva" : Hi Alan, Quoting Alan Stern : On Tue, 21 Feb 2017, Gustavo A. R. Silva wrote: Code refactoring to make the flow easier to follow and add missing 'continue' for case USB_ENDPOINT_XFER_INT. Addresses-Coverity-ID: 1248733 Cc: Alan

Re: [PATCH] usb: misc: remove unnecessary code

2017-02-21 Thread Gustavo A. R. Silva
Hi Peter, Quoting Peter Senna Tschudin : On Mon, Feb 20, 2017 at 05:28:46PM -0600, Gustavo A. R. Silva wrote: 'val' is an unsigned variable, and less-than-zero comparison of an unsigned variable is never true. I would add that val is set by kstrtoul() that converts a string to a

Re: [PATCH v3] usb: gadget: udc: remove pointer dereference after free

2017-03-10 Thread Gustavo A. R. Silva
Hello, Quoting Felipe Balbi : "Gustavo A. R. Silva" writes: Remove pointer dereference after free. Addresses-Coverity-ID: 1091173 Acked-by: Michal Nazarewicz Signed-off-by: Gustavo A. R. Silva --- Changes in v2: Move pointer dereference before pci_pool_free() Set point

[PATCH v4] usb: gadget: udc: remove pointer dereference after free

2017-03-10 Thread Gustavo A. R. Silva
Remove pointer dereference after free. Addresses-Coverity-ID: 1091173 Acked-by: Michal Nazarewicz Signed-off-by: Gustavo A. R. Silva --- Changes in v2: Move pointer dereference before pci_pool_free() Set pointer to NULL after free Changes in v3: Remove 'td->next = 0x00' in

[PATCH] usb: misc: add missing continue and refactor code

2017-04-03 Thread Gustavo A. R. Silva
-Code refactoring to make the flow easier to follow. -Add missing 'continue' for case USB_ENDPOINT_XFER_INT. Addresses-Coverity-ID: 1248733 Cc: Alan Stern Signed-off-by: Gustavo A. R. Silva --- drivers/usb/misc/usbtest.c | 68 +- 1 file c

[PATCH 1/2] usb: misc: add missing continue in switch

2017-04-03 Thread Gustavo A. R. Silva
Add missing continue in switch. Addresses-Coverity-ID: 1248733 Cc: Alan Stern Cc: Greg Kroah-Hartman Signed-off-by: Gustavo A. R. Silva --- drivers/usb/misc/usbtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 3525626

Re: [PATCH] usb: misc: add missing continue and refactor code

2017-04-03 Thread Gustavo A. R. Silva
Quoting Alan Stern : On Mon, 3 Apr 2017, Greg Kroah-Hartman wrote: On Mon, Apr 03, 2017 at 09:39:53AM -0500, Gustavo A. R. Silva wrote: > -Code refactoring to make the flow easier to follow. > -Add missing 'continue' for case USB_ENDPOINT_XFER_INT. Don't do multiple thi

[PATCH 2/2] usb: misc: refactor code

2017-04-03 Thread Gustavo A. R. Silva
Code refactoring to make the flow easier to follow. Cc: Alan Stern Cc: Greg Kroah-Hartman Signed-off-by: Gustavo A. R. Silva --- drivers/usb/misc/usbtest.c | 67 +- 1 file changed, 30 insertions(+), 37 deletions(-) diff --git a/drivers/usb/misc

Re: [PATCH 2/2] usb: misc: refactor code

2017-04-03 Thread Gustavo A. R. Silva
Hi Alan, Quoting Alan Stern : On Mon, 3 Apr 2017, Gustavo A. R. Silva wrote: Code refactoring to make the flow easier to follow. Cc: Alan Stern Cc: Greg Kroah-Hartman Signed-off-by: Gustavo A. R. Silva --- drivers/usb/misc/usbtest.c | 67

[PATCH v2 2/2] usb: misc: refactor code

2017-04-03 Thread Gustavo A. R. Silva
Code refactoring to make the flow easier to follow. Cc: Alan Stern Cc: Greg Kroah-Hartman Signed-off-by: Gustavo A. R. Silva --- Changes in v2: Remove unfruitful changes in previous patch. Revert change to comment. drivers/usb/misc/usbtest.c | 49

[PATCH v2 1/2] usb: misc: add missing continue in switch

2017-04-03 Thread Gustavo A. R. Silva
Add missing continue in switch. Addresses-Coverity-ID: 1248733 Cc: Alan Stern Cc: Greg Kroah-Hartman Signed-off-by: Gustavo A. R. Silva --- Changes in v2: None. drivers/usb/misc/usbtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc

[PATCH v2 1/2] usb: gadget: udc: avoid use of freed pointer

2017-04-03 Thread Gustavo A. R. Silva
Rewrite udc_free_dma_chain() function to avoid use of pointer after free. Addresses-Coverity-ID: 1091172 Acked-by: Michal Nazarewicz Reviewed-by: Greg Kroah-Hartman Signed-off-by: Gustavo A. R. Silva --- Changes in v2: Remove 'td->next = 0x00' inside for loop. Remove unnece

[PATCH v2 2/2] usb: gadget: udc: remove unnecessary variable and update function prototype

2017-04-03 Thread Gustavo A. R. Silva
Remove unnecessary variable and update function prototype. Acked-by: Michal Nazarewicz Reviewed-by: Greg Kroah-Hartman Signed-off-by: Gustavo A. R. Silva --- Changes in v2: None. drivers/usb/gadget/udc/amd5536udc.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a

Re: [PATCH 2/2] usb: misc: refactor code

2017-04-04 Thread Gustavo A. R. Silva
Hello, Quoting Felipe Balbi : Hi, "Gustavo A. R. Silva" writes: Code refactoring to make the flow easier to follow. Cc: Alan Stern Cc: Greg Kroah-Hartman Signed-off-by: Gustavo A. R. Silva --- drivers/usb/misc/usbtest.c | 67 +

Re: [PATCH] USB: serial: io_edgeport: fix up switch fall-through comments

2019-05-02 Thread Gustavo A. R. Silva
with the parsing logic of a data packet. Clean that logic > up a bit by unindenting one level of the logic, and properly label > /* Fall through */ to make gcc happy. > > Reported-by: Gustavo A. R. Silva > Signed-off-by: Greg Kroah-Hartman > Acked-by: Gustavo A. R. Silva Th

Re: [PATCH] USB: serial: io_edgeport: fix up switch fall-through comments

2019-05-03 Thread Gustavo A. R. Silva
lthrough. As part of that, the io_edgeport.c driver is a >> bit "messy" with the parsing logic of a data packet. Clean that logic >> up a bit by unindenting one level of the logic, and properly label >> /* Fall through */ to make gcc happy. >> >> Reported-by: Gust

[PATCH] usb: phy: ab8500-usb: Mark expected switch fall-throughs

2019-07-28 Thread Gustavo A. R. Silva
05: ^~~~ Reported-by: Stephen Rothwell Signed-off-by: Gustavo A. R. Silva --- drivers/usb/phy/phy-ab8500-usb.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index aaf363f19714..14b432982fd3 100644 --- a/driver

[PATCH] usb: host: ohci-tmio: Mark expected switch fall-throughs

2019-07-29 Thread Gustavo A. R. Silva
st/ohci-tmio.c:103:7: warning: this statement may fall through [-Wimplicit-fallthrough=] pm |= CCR_PM_USBPW2; ^ drivers/usb/host/ohci-tmio.c:104:3: note: here case 1: ^~~~ Signed-off-by: Gustavo A. R. Silva --- drivers/usb/host/ohci-tmio.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH] usb: gadget: atmel_usba_udc: Mark expected switch fall-through

2019-08-05 Thread Gustavo A. R. Silva
Mark switch cases where we are expecting to fall through. This patch fixes the following warning (Building: at91_dt_defconfig arm): drivers/usb/gadget/udc/atmel_usba_udc.c:329:13: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Gustavo A. R. Silva

[PATCH] USB: gadget: udc: s3c2410_udc: Mark expected switch fall-throughs

2019-08-05 Thread Gustavo A. R. Silva
: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/udc/s3c2410_udc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c index af3e63316ace

[PATCH] USB: wusbcore: crypto: Remove VLA usage

2018-03-16 Thread Gustavo A. R. Silva
, in which case the code would look as follows instead: iv = kcalloc(crypto_skcipher_ivsize(tfm_cbc), sizeof(*iv), GFP_KERNEL); but if the data type of _iv_ never changes, or the type size is always one byte, kzalloc is good enough. Signed-off-by: Gustavo A. R. Silva --- drivers/usb/wusbcore

Re: [PATCH] USB: wusbcore: crypto: Remove VLA usage

2018-03-16 Thread Gustavo A. R. Silva
I just discovered an issue with this patch. Please, drop it. I'll send v2 shortly. Thanks -- Gustavo On 03/16/2018 08:01 AM, Gustavo A. R. Silva wrote: In preparation to enabling -Wvla, remove VLA and replace it with dynamic memory allocation instead. The use of stack Variable L

[PATCH v2] USB: wusbcore: crypto: Remove VLA usage

2018-03-16 Thread Gustavo A. R. Silva
, in which case the code would look as follows instead: iv = kcalloc(crypto_skcipher_ivsize(tfm_cbc), sizeof(*iv), GFP_KERNEL); but if the data type of _iv_ never changes, or the type size is always one byte, kzalloc is good enough. Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Fix a

[PATCH] usb: core: hcd: mark expected switch fall-through

2018-04-23 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1468266 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva --- drivers/usb/core/hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/d

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

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

[PATCH] usbip: vhci_sysfs: fix potential Spectre v1

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

Re: [PATCH] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-17 Thread Gustavo A. R. Silva
Hi Greg, On 05/17/2018 01:51 AM, Greg Kroah-Hartman wrote: On Wed, May 16, 2018 at 05:22:00PM -0500, Gustavo A. R. Silva wrote: pdev_nr and rhport can be controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with

Re: [PATCH] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-17 Thread Gustavo A. R. Silva
On 05/17/2018 02:15 PM, Greg Kroah-Hartman wrote: Shouldn't we just do this in one place, in the valid_port() function? That way it keeps the range checking logic in one place (now it is in 3 places in the function), which should make maintenance much simpler. Yep, I thought about that, the

[PATCH v2] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-17 Thread Gustavo A. R. Silva
ed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- Changes in v2: - Place the barriers into valid_port. drivers/usb/usbip/vhci_sysfs.c | 6 ++ 1 file changed, 6 insert

Re: [PATCH v2] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-18 Thread Gustavo A. R. Silva
On 05/18/2018 11:06 AM, Shuah Khan wrote: On 05/18/2018 07:47 AM, Greg Kroah-Hartman wrote: On Thu, May 17, 2018 at 03:16:28PM -0500, Gustavo A. R. Silva wrote: pdev_nr and rhport can be controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1

[PATCH v3] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-18 Thread Gustavo A. R. Silva
ed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: sta...@vger.kernel.org Signed-off-by: Gustavo A. R. Silva --- Changes in v3: - Pass the addresses of pdev_nr and rhport into valid_port and valid_args. Changes in v2: - Place t

Re: [PATCH v2] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-19 Thread Gustavo A. R. Silva
On 05/19/2018 02:04 AM, Greg Kroah-Hartman wrote: Greg, I've been talking with Dan Williams (intel) about this kind of issues [1] and it seems my original assumptions are correct. Hence, this patch is not useful and, in order to actually prevent speculation here we would need to pass the addr

Re: [PATCH v3] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-22 Thread Gustavo A. R. Silva
On 05/22/2018 10:56 AM, Shuah Khan wrote: On 05/18/2018 07:13 PM, Gustavo A. R. Silva wrote: pdev_nr and rhport can be controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: drivers/usb

[PATCH] usb: phy: phy-msm-usb: mark expected switch fall-through

2017-10-23 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1222118 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/phy/phy-msm-usb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/phy/phy-msm-usb.c b

[PATCH] usb: image: mdc800: mark expected switch fall-through

2017-10-23 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/usb/image/mdc800.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c index

[PATCH] usb: core: urb: mark expected switch fall-through

2017-10-23 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1162594 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/core/urb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/core/urb.c b/drivers/usb/core

[PATCH] usb: gadget: f_tcm: mark expected switch fall-through

2017-10-23 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 703128 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/function/f_tcm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/function

[PATCH] usb: musb_core: mark expected switch fall-through

2017-10-23 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1397608 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/musb/musb_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/musb/musb_core.c b

[PATCH] usb: gadget: serial: mark expected switch fall-through

2017-10-23 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1350962 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/function/u_serial.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget

[PATCH] usb: gadget: goku_udc: mark expected switch fall-throughs

2017-10-23 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 145713 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/udc/goku_udc.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a

[PATCH] usb: storage: uas: mark expected switch fall-through

2017-10-24 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115016 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/storage/uas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/storage/uas.c b/drivers/usb

[PATCH] usb: serial: kobil_sct: mark expected switch fall-through

2017-10-24 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115014 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/serial/kobil_sct.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/serial/kobil_sct.c b

[PATCH] usb: gadget: f_phonet: mark expected switch fall-throughs

2017-10-24 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115004 Addresses-Coverity-ID: 115005 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/gadget/function/f_phonet.c | 2 ++ 1 file changed, 2 insertions(+) diff

[PATCH] usb: host: isp116x-hcd: mark expected switch fall-throughs

2017-10-24 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115006 Addresses-Coverity-ID: 115007 Signed-off-by: Gustavo A. R. Silva --- drivers/usb/host/isp116x-hcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a

[PATCH] usb: atm: cxacru: mark expected switch fall-throughs

2017-10-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/usb/atm/cxacru.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index 600a670

[PATCH] usb: class: usbtmc: mark expected switch fall-through

2017-10-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/usb/class/usbtmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index

[PATCH] usb: gadget: composite: mark expected switch fall-throughs

2017-10-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 --- drivers/usb/gadget/composite.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/composite.c b/drivers

[PATCH] usb: gadget: udc: dummy_hcd: mark expected switch fall-throughs

2017-10-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 --- drivers/usb/gadget/udc/dummy_hcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget

[PATCH 3/9] usb: host: xhci-mem: mark expected switch fall-through

2017-10-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 --- drivers/usb/host/xhci-mem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index

[PATCH 7/9] usb: host: oxu210hp-hcd: mark expected switch fall-through

2017-10-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 --- drivers/usb/host/oxu210hp-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb

[PATCH 6/9] usb: host: isp1362-hcd: mark expected switch fall-through

2017-10-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 --- drivers/usb/host/isp1362-hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c

[PATCH 9/9] usb: host: pci-quirks: mark expected switch fall-through

2017-10-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 --- drivers/usb/host/pci-quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host

[PATCH 8/9] usb: host: xhci-hub: mark expected switch fall-through

2017-10-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 --- drivers/usb/host/xhci-hub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index

Re: [PATCH 6/9] usb: host: isp1362-hcd: mark expected switch fall-through

2017-10-25 Thread Gustavo A. R. Silva
Greg, Quoting "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/usb/host/isp1362-hcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/driver

[PATCH 2/9] usb: host: xhci: mark expected switch fall-through

2017-10-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 --- drivers/usb/host/xhci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index ee077a2

[PATCH 4/9] usb: host: ohci-hcd: mark expected switch fall-through

2017-10-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 --- drivers/usb/host/ohci-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci

[PATCH 0/9] mark expected switch fall-throughs

2017-10-25 Thread Gustavo A. R. Silva
place. So I replaced them with proper "fall through" comments, which is what GCC is expecting to find. Thanks! Gustavo A. R. Silva (9): usb: host: fotg210-hcd: mark expected switch fall-through usb: host: xhci: mark expected switch fall-through usb: host: xhci-mem: mark expected s

[PATCH 1/9] usb: host: fotg210-hcd: mark expected switch fall-through

2017-10-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 --- drivers/usb/host/fotg210-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb

[PATCH 5/9] usb: host: ehci-hcd: mark expected switch fall-through

2017-10-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 --- drivers/usb/host/ehci-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci

[PATCH] usb: wusbcore: wa-xfer: mark expected switch fall-through

2017-10-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 --- drivers/usb/wusbcore/wa-xfer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c

Re: [PATCH] usb: gadget: composite: mark expected switch fall-throughs

2017-10-26 Thread Gustavo A. R. Silva
Hi Felipe, Quoting Felipe Balbi : "Gustavo A. R. Silva" writes: In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva Acked-by: Felipe Balbi Thank you for the ACKs. -- Gustavo A

[PATCH] usb: storage: sddr55: mark expected switch fall-through

2017-10-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/usb/storage/sddr55.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c index

[PATCH] usb: typec: tps6598x: mark expected switch fall-through

2017-10-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/usb/typec/tps6598x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tps6598x.c index

Re: [PATCH] USB: serial: io_edgeport: mark expected switch fall-throughs

2017-10-28 Thread Gustavo A. R. Silva
Quoting Bjørn Mork : "Gustavo A. R. Silva" writes: In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case I replaced "...drop on through" comments with a proper "fall through

  1   2   >