[PATCH] usb: phy: tahvo: fix error handling in tahvo_usb_probe()

2017-10-20 Thread Alexey Khoroshilov
If devm_extcon_dev_allocate() fails, we should disable clk before return. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> Fixes: 860d2686fda7 ("usb: phy: tahvo: Use devm_extcon_dev_[allocate|register]()

Re: [PATCH] usb: gadget: pch_udc: add checks for dma mapping errors

2017-09-02 Thread Alexey Khoroshilov
On 24.08.2017 04:02, Jack Pham wrote: > On Thu, Aug 24, 2017 at 01:47:08AM +0300, Alexey Khoroshilov wrote: >> There are no checks for dma mapping errors in pch_udc. >> Tha patch adds the checks and error handling code. >> Compile tested only. >> >> Found by

[PATCH] usb: gadget: pch_udc: add checks for dma mapping errors

2017-08-23 Thread Alexey Khoroshilov
There are no checks for dma mapping errors in pch_udc. Tha patch adds the checks and error handling code. Compile tested only. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/usb/gadget/udc/pch_udc.

Re: Inconsistency in usb_add_gadget_udc_release() interface

2017-08-16 Thread Alexey Khoroshilov
On 16.08.2017 18:24, Alan Stern wrote: > On Wed, 16 Aug 2017, Alexey Khoroshilov wrote: > >> Hello, >> >> usb_add_gadget_udc_release() gets release() argument that allows to >> release user resources. >> >> As far as I can s

Inconsistency in usb_add_gadget_udc_release() interface

2017-08-15 Thread Alexey Khoroshilov
ths? -- Alexey Khoroshilov Linux Verification Center, ISPRAS web: http://linuxtesting.org -- 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

[PATCH] usb: gadget: mv_u3d: fix error handling in mv_u3d_probe()

2017-03-31 Thread Alexey Khoroshilov
res failures in clk_enable(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/usb/gadget/udc/mv_u3d_core.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/driv

[PATCH] usbtmc: don't return zero on failure path in usbtmc_probe()

2017-03-17 Thread Alexey Khoroshilov
usbtmc_probe() returns zero in case of allocation failures. The patch fixes that. By the way it rearranges error lables just to improve readability of quite complex dependencies in error handling code. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey

Re: [PATCH v2 1/2] usb: gadget: mv_u3d: add check for dma mapping error

2016-11-03 Thread Alexey Khoroshilov
On 03.11.2016 16:34, Felipe Balbi wrote: > > Hi, > > Alexey Khoroshilov <khoroshi...@ispras.ru> writes: >> mv_u3d_req_to_trb() does not check for dma mapping errors. >> >> Found by Linux Driver Verification project (linuxtesting.org). >> >> v2: spl

[PATCH v2 2/2] usb: gadget: mv_u3d: mv_u3d_start_queue() refactoring

2016-11-03 Thread Alexey Khoroshilov
The patch improves readability of mv_u3d_start_queue() by rearranging its code with two semantic modifications: - assignment zero to ep->processing if usb_gadget_map_request() fails; - propagation of error code from mv_u3d_req_to_trb() instead of hardcoded -ENOMEM. Signed-off-by: Ale

[PATCH v2 1/2] usb: gadget: mv_u3d: add check for dma mapping error

2016-11-03 Thread Alexey Khoroshilov
mv_u3d_req_to_trb() does not check for dma mapping errors. Found by Linux Driver Verification project (linuxtesting.org). v2: split fix and clenup to separate patches. Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/usb/gadget/udc/mv_u3d_core.c | 6 ++ 1 file c

[PATCH] usb: gadget: mv_u3d: add check for dma mapping error

2016-10-28 Thread Alexey Khoroshilov
rom mv_u3d_req_to_trb() instead of hardcoded -ENOMEM. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/usb/gadget/udc/mv_u3d_core.c | 34 +- 1 file changed, 21 insertions(+), 13

[PATCH] usb: gadget: goku_udc: fix memory leak in goku_probe()

2016-08-25 Thread Alexey Khoroshilov
Memory allocated for goku_udc device is not deallocated at error paths in goku_probe(), because gadget_release() destructor is not registered yet. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/usb/gadg

[PATCH 1/2] USB: mos7720: fix non-atomic allocation in write path

2016-08-11 Thread Alexey Khoroshilov
There is an allocation with GFP_KERNEL flag in mos7720_write(), while it may be called from interrupt context. Follow-up for commit 191252837626 ("USB: kobil_sct: fix non-atomic allocation in write path") Found by Linux Driver Verification project (linuxtesting.org). Signed-off-

[PATCH 2/2] USB: mos7840: fix non-atomic allocation in write path

2016-08-11 Thread Alexey Khoroshilov
There is an allocation with GFP_KERNEL flag in mos7840_write(), while it may be called from interrupt context. Follow-up for commit 191252837626 ("USB: kobil_sct: fix non-atomic allocation in write path") Found by Linux Driver Verification project (linuxtesting.org). Signed-off-

[PATCH v2] USB: whci-hcd: add more checks for dma mapping error

2016-03-26 Thread Alexey Khoroshilov
Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/usb/host/whci/qset.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/whci/qset.c b/drivers/usb/host/whci/qset.c index 1a8e960d073b..c0e6812426b3

Re: [PATCH] USB: whci-hcd: add more checks for dma mapping error

2016-03-25 Thread Alexey Khoroshilov
On 26.03.2016 01:03, Vladimir Zapolskiy wrote: On 25.03.2016 22:23, Alexey Khoroshilov wrote: Fixing checks for dma mapping error in qset_fill_page_list(), I have missed two similar problems in qset_add_urb_sg() and in qset_add_urb_sg_linearize(). Found by Linux Driver Verification project

[PATCH] USB: whci-hcd: add more checks for dma mapping error

2016-03-25 Thread Alexey Khoroshilov
Fixing checks for dma mapping error in qset_fill_page_list(), I have missed two similar problems in qset_add_urb_sg() and in qset_add_urb_sg_linearize(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/us

[PATCH] usb: gadget: bdc_udc: fix race condition in bdc_udc_exit()

2016-02-26 Thread Alexey Khoroshilov
elease bdc->lock around bdc_ep_disable() in bdc_udc_exit(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/usb/gadget/udc/bdc/bdc_udc.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/usb

[PATCH] USB: whci-hcd: add check for dma mapping error

2015-11-20 Thread Alexey Khoroshilov
qset_fill_page_list() do not check for dma mapping errors. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/usb/host/whci/qset.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/hos

Re: [PATCH] usb: gadget: pch-udc: fix lock

2015-09-29 Thread Alexey Khoroshilov
spin_lock(>lock); <--- deadlock if (dev->driver) { spin_lock(>lock); } <--- deadlock -- Alexey On 28.09.2015 18:49, Felipe Balbi wrote: > gadget methods should be called without > spinlocks held. > > Reported-by: Alexey Khoroshilov <khoroshi...@

Deadlock in pch_udc_svc_ur_interrupt()

2015-09-28 Thread Alexey Khoroshilov
dev_intr); pch_udc_svc_ur_interrupt(dev); empty_req_queue(ep); complete_req(ep, req, -ESHUTDOWN); spin_lock(>lock); <--- deadlock if (dev->driver) { spin_lock(>lock); } <--- deadlock Found by Linux Driver Verification project (linux

[PATCH] usb: gadget: amd5536udc: fix error handling in udc_pci_probe()

2015-09-05 Thread Alexey Khoroshilov
ced by iounmap(dev->virt_addr) in udc_pci_remove() for clarity. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshi...@ispras.ru> --- drivers/usb/gadget/udc/amd5536udc.c | 43 + 1 file changed, 2

[PATCH] usb: gadget: mv_udc_core: fix phy_regs I/O memory leak

2015-07-19 Thread Alexey Khoroshilov
There was an omission in transition to devm_xxx resource handling. iounmap(udc-phy_regs) were removed, but ioremap() was left without devm_. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru Fixes: 3517c31a8ece6 (usb: gadget

[PATCH] usb: host: oxu210hp-hcd: Fix deadlock in oxu_qh_alloc()

2015-01-23 Thread Alexey Khoroshilov
of ehci_qtd_alloc(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/usb/host/oxu210hp-hcd.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb

[PATCH] usb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb()

2015-01-09 Thread Alexey Khoroshilov
() as well. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/net/usb/kaweth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index dcb6d33141e0

[PATCH] usbip: fix error handling in stub_probe()

2014-11-28 Thread Alexey Khoroshilov
If usb_hub_claim_port() fails, no resources are deallocated and if stub_add_files() fails, port is not released. The patch fixes these issues and rearranges error handling code. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi

[PATCH] USB: dbgp gadget: fix use after free in dbgp_unbind()

2014-08-10 Thread Alexey Khoroshilov
that still stores a pointer to already deallocated memory. The patch sets pointers to NULL in dbgp_unbind(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/usb/gadget/legacy/dbgp.c | 2 ++ 1 file changed, 2

[PATCH] usb: host: max3421-hcd: unconditionally use GFP_ATOMIC in max3421_urb_enqueue()

2014-06-19 Thread Alexey Khoroshilov
As far as kzalloc() is called with spinlock held, we have to pass GFP_ATOMIC regardless of mem_flags argument. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/usb/host/max3421-hcd.c | 2 +- 1 file changed, 1

[PATCH] usb: gadget: gr_udc: unconditionally use GFP_ATOMIC in gr_queue_ext()

2014-05-07 Thread Alexey Khoroshilov
As far as gr_queue() is called with spinlock held, we have to pass GFP_ATOMIC regardless of gfp argument. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/usb/gadget/gr_udc.c | 2 +- 1 file changed, 1 insertion

[PATCH] USB: cdc-acm: fix double usb_autopm_put_interface() in acm_port_activate()

2014-04-11 Thread Alexey Khoroshilov
Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/usb/class/cdc-acm.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 900f7ff805ee..d5d2c922186a 100644

[PATCH] USB: wusbcore: fix usb_dev leaks

2013-10-18 Thread Alexey Khoroshilov
Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/usb/wusbcore/cbaf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/wusbcore/cbaf.c b/drivers/usb/wusbcore/cbaf.c index 7f78f30..4035004 100644 --- a/drivers/usb/wusbcore

[PATCH] usb: gadget: amd5536udc: unconditionally use GFP_ATOMIC in udc_queue()

2013-08-01 Thread Alexey Khoroshilov
As far as prep_dma() is called with spinlock held, we have to pass GFP_ATOMIC regardless of gfp argument. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/usb/gadget/amd5536udc.c | 4 ++-- 1 file changed, 2

Re: [PATCH] usb: gadget: mv_u3d_core: fix violation of locking discipline in mv_u3d_ep_disable()

2013-07-29 Thread Alexey Khoroshilov
On 07/29/2013 04:52 PM, Felipe Balbi wrote: Hi, On Fri, Jul 26, 2013 at 07:26:05PM +0400, Alexey Khoroshilov wrote: On 07/25/2013 09:30 PM, Felipe Balbi wrote: On Wed, Jul 24, 2013 at 12:20:17AM +0400, Alexey Khoroshilov wrote: mv_u3d_nuke() expects to be calles with ep-u3d-lock held

Re: [PATCH] usb: gadget: mv_u3d_core: fix violation of locking discipline in mv_u3d_ep_disable()

2013-07-26 Thread Alexey Khoroshilov
Hi Felipe, On 07/25/2013 09:30 PM, Felipe Balbi wrote: On Wed, Jul 24, 2013 at 12:20:17AM +0400, Alexey Khoroshilov wrote: mv_u3d_nuke() expects to be calles with ep-u3d-lock held, because mv_u3d_done() does. But mv_u3d_ep_disable() calls it without lock that can lead to unpleasant

[PATCH] usb: gadget: mv_u3d_core: fix violation of locking discipline in mv_u3d_ep_disable()

2013-07-23 Thread Alexey Khoroshilov
mv_u3d_nuke() expects to be calles with ep-u3d-lock held, because mv_u3d_done() does. But mv_u3d_ep_disable() calls it without lock that can lead to unpleasant consequences. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru

[PATCH] USB: fix PTR_ERR translation in init_usb_class()

2013-06-05 Thread Alexey Khoroshilov
There is a misprint in init_usb_class(): IS_ERR is used to get error code instead of PTR_ERR. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/usb/core/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] usb: gadget: r8a66597-udc: do not unlock unheld spinlock in r8a66597_sudmac_irq()

2013-05-29 Thread Alexey Khoroshilov
moves locking before calling r8a66597_sudmac_irq(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/usb/gadget/r8a66597-udc.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb

[PATCH] usb/core/devio.c: Don't use GFP_KERNEL while we cannot reset a storage device

2013-03-08 Thread Alexey Khoroshilov
between usb_lock_device() and usb_unlock_device(). Replace by GFP_NOIO. The patch fixes the same issue in usb/core/devio.c. All the allocations fixed are under usb_lock_device() from usbdev_do_ioctl(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov

[PATCH] uwb: fix uwb_dev_unlock() missed at an error path in uwb_rc_cmd_async()

2012-11-26 Thread Alexey Khoroshilov
There is the only path in uwb_rc_cmd_async() where rc-uwb_dev is left unlocked. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/uwb/reset.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/uwb

[PATCH] USB: omninet: fix potential tty NULL dereference

2012-09-13 Thread Alexey Khoroshilov
Add check for return value of tty_port_tty_get, since it can return NULL after port hangup that may happen anytime. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/usb/serial/omninet.c |8 +--- 1 file

[PATCH] wusb: Fix potential memory leak in wusb_dev_sec_add()

2012-08-08 Thread Alexey Khoroshilov
Do not leak memory by updating pointer with potentially NULL realloc return value. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov khoroshi...@ispras.ru --- drivers/usb/wusbcore/security.c |7 --- 1 file changed, 4 insertions(+), 3