[PATCH] typec: tcpm: fix a typo in the comparison of pdo_max_voltage

2019-08-22 Thread Colin King
From: Colin Ian King There appears to be a typo in the comparison of pdo_max_voltage[i] with the previous value, currently it is checking against the array pdo_min_voltage rather than pdo_max_voltage. I believe this is a typo. Fix this. Addresses-Coverity: ("Copy-paste error") Fixes: 5007e1b5db7

[PATCH] USB: storage: isd200: remove redundant assignment to variable sendToTransport

2019-08-09 Thread Colin King
From: Colin Ian King The variable sendToTransport is being initialized with a value that is never read and is being re-assigned a little later on. The assignment is redundant and hence can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/usb/storage/is

[PATCH] usb: musb: remove redundant assignment to variable ret

2019-07-31 Thread Colin King
From: Colin Ian King Variable ret is being initialized with a value that is never read and ret is being re-assigned a little later on. The assignment is redundant and hence can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/usb/musb/musb_core.c | 2 +

[PATCH][next] usb: typec: mux: fix an unsigned less than zero check

2019-02-19 Thread Colin King
From: Colin Ian King The checks of a negative nval indicating an error an never be true as nval is currently a size_t which is of course unsigned and hence never less than zero. Fix this by making nval an int. Detected by CoverityScan, CID#1476863 ("Unsigned compared against 0) and CID#1476948

[PATCH][next] usb: typec: mux: remove redundant check on variable match

2019-02-19 Thread Colin King
From: Colin Ian King All the code paths that lead to the return statement are where match is always true, hence the check to see if it is true is redundant and can be removed. Detected by CoverityScan, CID#14769672 ("Logically dead code") Signed-off-by: Colin Ian King --- drivers/usb/typec/mu

[PATCH] USB: renesas_usbhs: fix spelling mistake "doens't" -> "doesn't"

2019-02-17 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King --- drivers/usb/renesas_usbhs/mod_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c

[PATCH] usb: host: oxu210hp-hcd: fix indentation issue

2019-02-08 Thread Colin King
From: Colin Ian King A statement is indented too deeply, fix this by removing a tab. Signed-off-by: Colin Ian King --- 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/host/oxu210hp-hcd.c index c5e

[PATCH] usb: gadget: fix various indentation issues

2019-01-22 Thread Colin King
From: Colin Ian King There are a bunch of various indentation issues, clean these up. Signed-off-by: Colin Ian King --- drivers/usb/gadget/function/f_uac1.c | 8 ++--- drivers/usb/gadget/legacy/inode.c| 40 drivers/usb/gadget/udc/aspeed-vhub/hub.c | 2 +-

[PATCH] USB: musb: fix indentation issue on a return statement

2019-01-04 Thread Colin King
From: Colin Ian King A return statement is indented one level too far, fix this by removing a tab. Signed-off-by: Colin Ian King --- drivers/usb/musb/musb_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c inde

[PATCH] usb: host: u132-hcd: fix a couple of indentation issues

2019-01-04 Thread Colin King
From: Colin Ian King There are two statements that are indented incorrectly and need to be moved to a new line. Fix these. Signed-off-by: Colin Ian King --- drivers/usb/host/u132-hcd.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/u132-hcd.c b/driv

[PATCH] USB: ene_usb6250: add missing indentation

2018-11-19 Thread Colin King
From: Colin Ian King There is a missing indentation before the return statement. Add it. Signed-off-by: Colin Ian King --- drivers/usb/storage/ene_ub6250.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/storage/ene_ub6250.c b/drivers/usb/storage/ene_ub6250.c in

[PATCH] drivers: usb: early: clean up indentation, remove extraneous tabs

2018-11-19 Thread Colin King
From: Colin Ian King There is a hunk of code that is indented too much by one level, fix this by removing the extraneous tabs. Signed-off-by: Colin Ian King --- drivers/usb/early/ehci-dbgp.c | 38 +-- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git

[PATCH] uwb: clean an indentation issue, remove extraneous tab

2018-10-30 Thread Colin King
From: Colin Ian King Trivial fix to clean up an indentation issue, remove tab Signed-off-by: Colin Ian King --- drivers/uwb/i1480/dfu/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/uwb/i1480/dfu/usb.c b/drivers/uwb/i1480/dfu/usb.c index c0430a41e24b..b1b466cb

[PATCH] USB: gadget: udc: fix spelling mistake "intrerrupt" -> "interrupt"

2018-10-29 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in comment Signed-off-by: Colin Ian King --- drivers/usb/gadget/udc/pch_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c index afaea11ec771..55c8c8a

[PATCH] usbip: tools: fix atoi() on non-null terminated string

2018-10-16 Thread Colin King
From: Colin Ian King Currently the call to atoi is being passed a single char string that is not null terminated, so there is a potential read overrun along the stack when parsing for an integer value. Fix this by instead using a 2 char string that is initialized to all zeros to ensure that a 1

[PATCH][usb-next] usb: core: fix memory leak on port_dev_path allocation

2018-10-03 Thread Colin King
From: Colin Ian King Currently the allocation of port_dev_path from the call to kobject_get_path is not being kfree'd, causing a memory leak. Fix this by kfree'ing this at the end of the function. Add an extra error exit path to fix one of the early leaks when envp[0] fails to be allocated. Dete

[PATCH] usb: gadget: fix spelling mistakeis "[En]queing" -> "[En]queuing"

2018-09-29 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistakes in debug warning messages Signed-off-by: Colin Ian King --- drivers/usb/gadget/udc/aspeed-vhub/epn.c | 2 +- drivers/usb/gadget/udc/udc-xilinx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/

[PATCH] usb: usbtmc: check size before allocating buffer and remove duplicated allocation

2018-09-27 Thread Colin King
From: Colin Ian King Currently the allocation of a buffer is performed before a sanity check on the required buffer size and if the buffer size is too large the error exit return leaks the allocated buffer. Fix this by checking the size before allocating. Also, the same buffer is allocated agai

[PATCH] USB: serial: cypress_m8: fix spelling mistake "retreiving" -> "retrieving"

2018-09-23 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in dev_dbg message Signed-off-by: Colin Ian King --- drivers/usb/serial/cypress_m8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index e0035c023120..31

[PATCH] usb: phy: mxs: fix spelling mistake "stardard" -> "standard"

2018-09-17 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in dev_dbg message Signed-off-by: Colin Ian King --- drivers/usb/phy/phy-mxs-usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c index e5aa24c1e4fd..1b1bb0ad

[PATCH][usb-next] usb: core: remove unused variable 'flags'

2018-09-11 Thread Colin King
From: Colin Ian King The removal of the use of 'flags' in commit ed194d136769 ("usb: core: remove local_irq_save() around ->complete() handler") didn't remove the unused variable. Remove it. Cleans up warning: warning: unused variable ‘flags’ [-Wunused-variable] Signed-off-by: Colin Ian King -

[PATCH] usb: gadget: tcm: fix spelling mistake: "Manufactor" -> "Manufacturer"

2018-05-22 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in usbg_us_strings array Signed-off-by: Colin Ian King --- drivers/usb/gadget/legacy/tcm_usb_gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/legacy/tcm_usb_gadget.c b/drivers/usb/gadget/legacy

[PATCH] usb-misc: sisusbvga: fix spelling mistake: "asymmeric" -> "asymmetric"

2018-04-27 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in text string Signed-off-by: Colin Ian King --- drivers/usb/misc/sisusbvga/sisusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 3e65bdc

[PATCH][usb-next] usb: dwc2: ix spelling mistake: "genereted" -> "generated"

2018-03-13 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in dev_warn warning message text. Signed-off-by: Colin Ian King --- drivers/usb/dwc2/hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index dcfda5eb4cac..190f95964000 1

[PATCH] net/usb/kalmia: use ARRAY_SIZE for various array sizing calculations

2018-03-02 Thread Colin King
From: Colin Ian King Use the ARRAY_SIZE macro on a couple of arrays to determine size of the arrays. Also fix up alignment to clean up a checkpatch warning. Improvement suggested by Coccinelle. Signed-off-by: Colin Ian King --- drivers/net/usb/kalmia.c | 8 1 file changed, 4 insertion

[PATCH] usbip: vudc: fix null pointer dereference on udc->lock

2018-02-22 Thread Colin King
From: Colin Ian King Currently the driver attempts to spin lock on udc->lock before a NULL pointer check is performed on udc, hence there is a potential null pointer dereference on udc->lock. Fix this by moving the null check on udc before the lock occurs. Fixes: ea6873a45a22 ("usbip: vudc: Add

[PATCH] USB: gadget: function: remove redundant initialization of 'tv_nexus'

2018-01-26 Thread Colin King
From: Colin Ian King Pointer tv_nexus is being initialized a value and this is never read and is later being updated with the same value. Remove the redundant initialization so that the assignment to tv_nexus is performed later and more local to when it is being read. Cleans up clang warning: dr

[PATCH] USB: wusbcore: remove redundant re-assignment to pointer 'dev'

2018-01-26 Thread Colin King
From: Colin Ian King Pointer dev is initialized and then re-assigned with the same value a little later, hence the second assignment is redundant and can be removed. Cleans up clang warning: drivers/usb/wusbcore/wa-nep.c:88:17: warning: Value stored to 'dev' during its initialization is never re

[PATCH] USB: serial: remove redundant initializations of 'mos_parport'

2018-01-17 Thread Colin King
From: Colin Ian King The pointer mos_parport is being initialized to pp->private_data and then the assignment is duplicated after a spin lock. Remove the initialization as it occurs before the spin lock and it is a redundant assignment. Cleans up clang warnings: drivers/usb/serial/mos7720.c:521

[PATCH][next] usbip: vhci: fix spelling mistake: "synchronuously" -> "synchronously"

2018-01-03 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in dev_dbg debug message. Signed-off-by: Colin Ian King --- drivers/usb/usbip/vhci_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/usbip/vhci_rx.c b/drivers/usb/usbip/vhci_rx.c index 112ebb90d8c9..44cd645

[PATCH][usb-next] usb: xhci: make function xhci_dbc_free_req static

2017-12-11 Thread Colin King
From: Colin Ian King Function xhci_dbc_free_req is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'xhci_dbc_free_req' was not declared. Should it be static? Signed-off-by: Colin Ian King --- drivers/usb/host/xhci-dbgtty.c | 2 +

[PATCH] USB: atm: use setup_timer instead of init_timer

2017-11-24 Thread Colin King
From: Colin Ian King Use setup_timer function instead of initializing timer with the function and data fields. Signed-off-by: Colin Ian King --- drivers/usb/atm/usbatm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c

[PATCH] USB: gadget: udc: fix spelling mistake "unexpect" -> "unexpected"

2017-11-24 Thread Colin King
From: Colin Ian King Trival fix to spelling mistake in ERR message Signed-off-by: Colin Ian King --- drivers/usb/gadget/udc/fsl_udc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index d6

[PATCH] USB: usbip: fix spelling mistake: "synchronuously" -> "synchronously"

2017-11-22 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in error message text Signed-off-by: Colin Ian King --- drivers/usb/usbip/vhci_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/usbip/vhci_rx.c b/drivers/usb/usbip/vhci_rx.c index 90577e8b2282..a9813f1d507

[PATCH] USB: gadget: legacy: remove redundant zero assignment to variable 'value'

2017-11-22 Thread Colin King
From: Colin Ian King The variable value is being assigned to zero but that value is never being read. Either value is being reassigned in the following if condition, or it is never read and the function returns. In both cases the assignment is redundant and can be removed. Cleans up clang warnin

[PATCH] USB: serial: iuu_phoenix: remove redundant assignment of DIV to itself

2017-11-20 Thread Colin King
From: Colin Ian King The assignment of DIV to itself is redundant and can be removed. Signed-off-by: Colin Ian King --- drivers/usb/serial/iuu_phoenix.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c index 397a8012ffa3..62

[PATCH] USB: gadget: don't dereference g until after it has been null checked

2017-11-14 Thread Colin King
From: Colin Ian King Avoid dereferencing pointer g until after g has been sanity null checked; move the assignment of cdev much later when it is required into a more local scope. Detected by CoverityScan, CID#1222135 ("Dereference before null check") Fixes: b785ea7ce662 ("usb: gadget: composite

[PATCH] USB: host: whci: remove redundant variable t

2017-11-08 Thread Colin King
From: Colin Ian King Variable t is assigned but never read, it is redundant and therefore can be removed. Cleans up clang warning: drivers/usb/host/whci/asl.c:106:3: warning: Value stored to 't' is never read Signed-off-by: Colin Ian King --- drivers/usb/host/whci/asl.c | 2 -- 1 file changed

[PATCH] usb: gadget: udc-xilinx: remove redundant pointer udc

2017-11-08 Thread Colin King
From: Colin Ian King Pointer udc is assigned but never read, hence it is redundant and can be removed. Cleans up clang warning: drivers/usb/gadget/udc/udc-xilinx.c:974:2: warning: Value stored to 'udc' is never read Signed-off-by: Colin Ian King --- drivers/usb/gadget/udc/udc-xilinx.c | 2 --

[PATCH] usb: host: fix incorrect updating of offset

2017-11-07 Thread Colin King
From: Colin Ian King The variable temp is incorrectly being updated, instead it should be offset otherwise the loop just reads the same capability value and loops forever. Thanks to Alan Stern for pointing out the correct fix to my original fix. Fix also cleans up clang warning: drivers/usb/ho

[PATCH][V2] usb: gadget: pxa27x: Remove redundant assignment to is_short and dev

2017-11-07 Thread Colin King
From: Colin Ian King Variable is_short is set to zero but this value is never read as it is overwritten with a new value later on, hence it is a redundant assignment and can be removed. Pointer dev is assigned a value that is not read and it is updated a few statements later, this too is redunda

[PATCH] usb: gadget: pxa27x: Remove redundant assignment to is_short

2017-11-07 Thread Colin King
From: Colin Ian King Variable is set to zero but this value is never read as it is overwritten with a new value later on, hence it is a redundant assignment and can be removed. Cleans up clang warning: drivers/usb/gadget/udc/pxa27x_udc.c:1141:2: warning: Value stored to 'dev' is never read Sign

[PATCH] usb: host: isp1362-hcd: remove a couple of redundant assignments

2017-11-07 Thread Colin King
From: Colin Ian King Variable index is being initialized and the value is never read, it is being updated a few statements later, so remove the redundant initialization. Variable total is being updated but the value is never read, so this is also redundant and can be removed. Cleans up two clang

[PATCH] USB: adutux: remove redundant variable minor

2017-11-07 Thread Colin King
From: Colin Ian King Variable minor is being assigned but never read, hence it is redundant and can be removed. Cleans up clang warning: drivers/usb/misc/adutux.c:770:2: warning: Value stored to 'minor' is never read Signed-off-by: Colin Ian King --- drivers/usb/misc/adutux.c | 2 -- 1 file c

[PATCH] USB: remove redundant assignment to temp

2017-11-07 Thread Colin King
From: Colin Ian King The variable temp is being set at the end of each loop iteration but this value is never read, it is either being updated in just the case 1 block or at the end of the loop. Thus the assignment is redundant and can be removed. Cleans up clang warning: drivers/usb/host/ehci

[PATCH] usb: gadget: udc: renesas_usb3: make const array max_packet_array static

2017-11-02 Thread Colin King
From: Colin Ian King Don't populate the const array max_packet_array on the stack, instead make it static. Makes the object code smaller by over 90 bytes: Before: textdata bss dec hex filename 343375612 128 400779c8d renesas_usb3.o After: textdata b

[PATCH] USB: c67x00: remove redundant pointer urbp

2017-11-01 Thread Colin King
From: Colin Ian King Pointer urbp is assigned but is never read, hence it is redundant and can be removed. Cleans up clang warning: drivers/usb/c67x00/c67x00-sched.c:975:2: warning: Value stored to 'urbp' is never read Signed-off-by: Colin Ian King --- drivers/usb/c67x00/c67x00-sched.c | 2 --

[PATCH] net: hso: remove redundant unused variable dev

2017-10-31 Thread Colin King
From: Colin Ian King The pointer dev is being assigned but is never used, hence it is redundant and can be removed. Cleans up clang warning: drivers/net/usb/hso.c:2280:2: warning: Value stored to 'dev' is never read Signed-off-by: Colin Ian King --- drivers/net/usb/hso.c | 2 -- 1 file change

[PATCH] usb: typec: wcove: fix uninitialized usbc_irq1 and usbc_irq2

2017-10-11 Thread Colin King
From: Colin Ian King Calls to regmap_read may fail with an -EINVAL return without setting usbc_irq1 and usbc_irq2. The error handling clean up expects these to have been set (or zero on a failure) and currently may try to clear the wrong IRQs if the uninitalized garbage values in usbc_irq1 or us

[PATCH] usb: storage: make const arrays static, reduces object code size

2017-09-12 Thread Colin King
From: Colin Ian King Don't populate const arrays on the stack, instead make them static. Makes the object code smaller by over 1070 bytes: Before: textdata bss dec hex filename 3505 880 043851121 drivers/usb/storage/option_ms.o After: textdata

[PATCH] usb: gadget: dummy: fix infinite loop because of missing loop decrement

2017-08-15 Thread Colin King
From: Colin Ian King The while loop never terminates because the loop counter i is never decremented. Fix this by decrementing i. Detected by CoverityScan, CID#751073 ("Infinite Loop") Signed-off-by: Colin Ian King --- drivers/usb/gadget/udc/dummy_hcd.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH][V2] usb: storage: return on error to avoid a null pointer dereference

2017-07-06 Thread Colin King
From: Colin Ian King When us->extra is null the driver is not initialized, however, a later call to osd200_scsi_to_ata is made that dereferences us->extra, causing a null pointer dereference. The code currently detects and reports that the driver is not initialized; add a return to avoid the sub

[PATCH] usb: storage: return on error to avoid a null pointer dereference

2017-07-06 Thread Colin King
From: Colin Ian King When us->extra is null the driver is not initialized, however, a later call to osd200_scsi_to_ata is made that dereferences us->extra, causing a null pointer dereference. The code currently detects and reports that the driver is not initialized; add a return to avoid the sub

[PATCH] usb: renesas_usbhs: make array type_array static const

2017-07-04 Thread Colin King
From: Colin Ian King Array type_array can be made static const rather than being populated on the stack. Makes the object code smaller: Before: textdata bss dec hex filename 80871496 09583256f drivers/usb/renesas_usbhs/pipe.o After: textdata bs

[PATCH] usb: atm: ueagle-atm: fix spelling mistake: "submition" -> "submission"

2017-07-03 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in uea_err error message Signed-off-by: Colin Ian King --- drivers/usb/atm/ueagle-atm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index df67815f74e6..a7b69

[PATCH] fsl_udc_core: fix spelling mistake: "Dectected" -> "Detected"

2017-05-14 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in seq_printf text Signed-off-by: Colin Ian King --- drivers/usb/gadget/udc/fsl_udc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c ind

[PATCH] usb: gadget: pch_udc: don't update td->next after it has been released to the pool

2017-03-28 Thread Colin King
From: Colin Ian King Writing to td->next should be avoided after td has been freed using dma_pool_free. The intent was to nullify the next pointer, but this is potentially dangerous once it is back in the pool. Remove it. Detected by CoverityScan, CID#1091173 ("Write tp pointer after free") Sig

[PATCH] usb: gadget: udc: remove redundant initial assignments to the pointer 's'

2017-03-27 Thread Colin King
From: Colin Ian King The initial setting of pointer s to the driver name or to the literal string "(none)" is redundant as later it is always set to point to a different literal string before it is printed log. Remove this redundant code. Detected with CoverityScan, CID#1227032, CID#1227033 ("U

[PATCH] net: usb: asix_devices: fix missing return code check on call to asix_write_medium_mode

2017-02-28 Thread Colin King
From: Colin Ian King The call to asix_write_medium_mode is not updating the return code ret and yet ret is being checked for an error. Fix this by assigning ret to the return code from the call asix_write_medium_mode. Detected by CoverityScan, CID#1357148 ("Logically Dead Code") Signed-off-by:

[PATCH] usb: misc: usbtest: remove redundant check on retval < 0

2017-02-12 Thread Colin King
From: Colin Ian King The check for retval being less than zero is always true since retval equal to -EPIPE at that point. Replace the existing conditional with just return retval. Detected with CoverityScan, CID#114349 ("Logically dead code") Signed-off-by: Colin Ian King --- drivers/usb/mis

[PATCH] usb: storage: fix infinite wait loop by incrementing loop counter

2017-02-02 Thread Colin King
From: Colin Ian King If jumpshot_get_status continues to return a failed result then the wait loop will spin forever because the waitcount counter is never being incremented and we don't ever timeout. Fix this by incrementing waitcount. Cc: Signed-off-by: Colin Ian King --- drivers/usb/stora

[PATCH] usb: misc: adutux: remove redundant error check on copy_to_user return code

2017-02-02 Thread Colin King
From: Colin Ian King The 2nd check for a non-zero return from copy_to_user is redundant as it is has already been made a few lines earlier. This check was made redundant because of previous fix to the copy_to_user error return check. Detected by CoverityScan, CID#114347 ("Logically Dead Code")

[PATCH] HID: usbhid: Quirk a AMI virtual mouse and keyboard with ALWAYS_POLL

2017-01-26 Thread Colin King
From: Colin Ian King Quirking the following AMI USB device with ALWAYS_POLL fixes an AMI virtual keyboard and mouse from not responding and timing out when it is attached to a ppc64el Power 8 system and when we have some rapid open/closes on the mouse device. usb 1-3: new high-speed USB device

[PATCH] usb: renesas_usbhs: mod_host: fix typo: "connecte" -> "connected"

2016-12-28 Thread Colin King
From: Colin Ian King trivial fix to typo in dev_dbg message Signed-off-by: Colin Ian King --- drivers/usb/renesas_usbhs/mod_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c index 165e81b..dfb

[PATCH][V2] USB: wusbcore: add in missing white space in error message text

2016-09-12 Thread Colin King
From: Colin Ian King A dev_err message spans two lines and the literal string is missing a white space between words. Add the white space and reformat the message to not span multiple lines. Signed-off-by: Colin Ian King --- drivers/usb/wusbcore/cbaf.c | 3 +-- 1 file changed, 1 insertion(+),

[PATCH] USB: wusbcore: add in missing white space in error message text

2016-09-12 Thread Colin King
From: Colin Ian King A dev_err message spans two lines and the literal string is missing a white space between words. Add the white space. Signed-off-by: Colin Ian King --- drivers/usb/wusbcore/cbaf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/wusbcore/cbaf

[PATCH] usb: gadget: remove variable ret and remove unnecessary if statement

2016-09-08 Thread Colin King
From: Colin Ian King the if statement in lb_modinit is unnecessary so we can totally remove the variable ret and just return the return value from the call to usb_function_register. Signed-off-by: Colin Ian King --- drivers/usb/gadget/function/f_loopback.c | 8 ++-- 1 file changed, 2 inser

[PATCH] usb: gadget: prevent potenial null pointer dereference on skb->len

2016-09-05 Thread Colin King
From: Colin Ian King An earlier fix partially fixed the null pointer dereference on skb->len by moving the assignment of len after the check on skb being non-null, however it failed to remove the erroneous dereference when assigning len. Correctly fix this by removing the initialisation of len as

[PATCH] usb: phy: ab8500-usb: fix spelling mistake "regester" -> "register"

2016-08-28 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistakes in dev_err messages. Signed-off-by: Colin Ian King --- drivers/usb/phy/phy-ab8500-usb.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index 0c

[PATCH] usb: gadget: net2280: fix typo: "Inavlid" -> "Invalid"

2016-08-23 Thread Colin King
From: Colin Ian King trivial typo fix in dev_err message Signed-off-by: Colin Ian King --- drivers/usb/gadget/udc/net2280.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index 614ab951..d8c9ab4 100644 ---

[PATCH] usb: gadget: remove redundant self assignment

2016-07-25 Thread Colin King
From: Colin Ian King The assignment ret = ret is redundant and can be removed. Signed-off-by: Colin Ian King --- drivers/usb/gadget/udc/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c index ff8685e..48c

[PATCH] usb: gadget: bdc: fix spelling mistake: "allocted" -> "allocated"

2016-06-03 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake Signed-off-by: Colin Ian King --- drivers/usb/gadget/udc/bdc/bdc_ep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc_ep.c b/drivers/usb/gadget/udc/bdc/bdc_ep.c index d619950..b48b259 10064

[PATCH] usb/host/fotg210: remove dead code in create_sysfs_files

2016-05-08 Thread Colin King
From: Colin Ian King The goto in create_sysfs_files is never executed, so remove it and clean up the code. Signed-off-by: Colin Ian King --- drivers/usb/host/fotg210-hcd.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/ho

[PATCH] usb: hcd: do not call whc_clean_up on wch_init call failure

2016-03-26 Thread Colin King
From: Colin Ian King whc_init already calls whc_clean_up if an error occurs during the initialization, so calling it again if whc_init fails at the end of wch_probe will cause double free errors. Fix this by bailing out on an whc_init failure to a new label that avoids doing the duplicated whc_c

[PATCH] asix: do not free array priv->mdio->irq

2016-03-03 Thread Colin King
From: Colin Ian King Used to be allocated and required freeing, but now priv->mdio->irq is now a fixed sized array and should no longer be free'd. Issue detected using static analysis with CoverityScan Fixes: e7f4dc3536a400 ("mdio: Move allocation of interrupts into core") Signed-off-by: Colin

[PATCH][V3] usb: isp1760: check for null return from kzalloc

2015-06-02 Thread Colin King
From: Colin Ian King isp1760_ep_alloc_request allocates a structure with kzalloc without checking for NULL and then returns a pointer to one of the structure fields. As the field happens to be the first in the structure the caller can properly check for NULL, but this is risky if the structure

[PATCH][V2] usb: isp1760: fix null dereference if kzalloc returns null

2015-05-31 Thread Colin King
From: Colin Ian King If kzalloc returns null then isp1760_ep_alloc_request performs a null pointer dereference on req. Check for null to avoid this. Detected with smatch static analysis: drivers/usb/isp1760/isp1760-udc.c:816 isp1760_ep_alloc_request() error: potential null dereference 'req'.

[PATCH] usb: isp1760: fix null dereference if kzalloc returns null

2015-05-31 Thread Colin King
From: Colin Ian King If kzalloc returns null then isp1760_ep_alloc_request performs a null pointer deference on req. Check for null to avoid this. Detected with smatch static analysis: drivers/usb/isp1760/isp1760-udc.c:816 isp1760_ep_alloc_request() error: potential null dereference 'req'. (

[PATCH][V2] drivers/usb/serial/mos7840.c: remove unused code

2015-01-19 Thread Colin King
From: Colin Ian King There is old, unused code that is #defined out by the use of NOTMOS7840 and NOTMCS7840 - these are not defined anywhere. If NOTMOS7840 is defined then the code will break on null pointer dereferences on mos7840_port. So the code is currently unused, and broken anyway, so wh

[PATCH] drivers/usb/serial/mos7840.c: remove unused code

2015-01-13 Thread Colin King
From: Colin Ian King There is old, unused code that is #defined out by the use of NOTMOS7840 - this is not defined anywhere. If NOTMOS7840 is defined then the code will break on null pointer dereferences on mos7840_port. So the code is currently unused, and broken anyway, so why not just remove

[PATCH] usb: usb3503: return correct error return on failure

2014-06-29 Thread Colin King
From: Colin Ian King Fix warning: drivers/usb/misc/usb3503.c:195:11: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized] err is not initialized, the error return should be PTR_ERR(clk) Signed-off-by: Colin Ian King --- drivers/usb/misc/usb3503.c | 3 ++- 1 file

[PATCH] usb: misc: sisusbvga: Avoid NULL pointer dereference from sisusb

2013-03-15 Thread Colin King
From: Colin Ian King A failed kzalloc() is reported with a dev_err that dereferences the null sisusb, this will cause a NULL pointer deference error. Instead, pass dev->dev to the dev_err() rather than &sisusb->sisusb_dev->dev Smatch analysis: drivers/usb/misc/sisusbvga/sisusb.c:3087 sisusb_pr