Re: [PATCH] usbip: vhci_hcd: check port number before using

2018-10-08 Thread Sudip Mukherjee
On Mon, Oct 8, 2018 at 8:29 PM Shuah Khan wrote: > > Hi Sudip, > > On 10/08/2018 01:19 PM, Sudip Mukherjee wrote: > > From: Sudip Mukherjee > > > > The port number is checked and it just prints an error message but it > > still continues to use the inval

[PATCH] usbip: vhci_hcd: check port number before using

2018-10-08 Thread Sudip Mukherjee
From: Sudip Mukherjee The port number is checked and it just prints an error message but it still continues to use the invalid port. And as a result it accesses memory which is not its resulting in BUG report from KASAN. Reported-by: syzbot+600b03e0cf1b73bb2...@syzkaller.appspotmail.com Cc

Re: usb HC busted?

2018-06-04 Thread Sudip Mukherjee
Hi Mathias, On Thu, May 24, 2018 at 04:35:34PM +0300, Mathias Nyman wrote: > Hi > > On 24.05.2018 00:29, Sudip Mukherjee wrote: > > Hi Mathias, > > > > On Fri, May 18, 2018 at 04:19:02PM +0300, Mathias Nyman wrote: > > > On 18.05.2018 16:04, Sudip Mukherjee

Re: usb HC busted?

2018-06-03 Thread Sudip Mukherjee
Hi Mathias, On Thu, May 24, 2018 at 04:35:34PM +0300, Mathias Nyman wrote: > Hi > > On 24.05.2018 00:29, Sudip Mukherjee wrote: > >Hi Mathias, > > > >>>On Fri, May 18, 2018 at 03:55:04PM +0300, Mathias Nyman wrote: > >>>>Hi, > >>>&g

Re: usb HC busted?

2018-05-23 Thread Sudip Mukherjee
Hi Mathias, On Fri, May 18, 2018 at 04:19:02PM +0300, Mathias Nyman wrote: > On 18.05.2018 16:04, Sudip Mukherjee wrote: > > Hi Mathias, > > > > On Fri, May 18, 2018 at 03:55:04PM +0300, Mathias Nyman wrote: > > > Hi, > > > > > > Looks like event

Re: usb HC busted?

2018-05-18 Thread Sudip Mukherjee
Hi Mathias, On Fri, May 18, 2018 at 03:55:04PM +0300, Mathias Nyman wrote: > Hi, > > Looks like event for Transfer block (TRB) at 0x32a21060 was never completed, > or at least not handled by xhci driver. > (either the event was never issued by hw, or something got messed up in the > driver along

usb HC busted?

2018-05-18 Thread Sudip Mukherjee
Hi Mathias, We are using an Intel Atom based board and the usb controller is: 00:14.0 USB Controller: Intel Corporation Device 0f35 (rev 11) (prog-if 30) Flags: bus master, medium devsel, latency 0, IRQ 130 Memory at df7e (64-bit, non-prefetchable) [size=64K] Capabilit

[PATCH v2] usb: host: oxu210hp-hcd: remove unused variable

2017-01-12 Thread Sudip Mukherjee
From: Sudip Mukherjee The variable live was assigned the host controller running status but it was never used or checked after that. Signed-off-by: Sudip Mukherjee --- v2: added From: tag drivers/usb/host/oxu210hp-hcd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/host

[PATCH v2] usb: storage: ene_ub6250: remove unused variable

2017-01-12 Thread Sudip Mukherjee
From: Sudip Mukherjee The variable Newblk was only being assigned some value but was never used after that. Signed-off-by: Sudip Mukherjee --- v2: added From: line drivers/usb/storage/ene_ub6250.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/storage/ene_ub6250.c b

Re: [PATCH] usb: storage: ene_ub6250: remove unused variable

2017-01-07 Thread Sudip Mukherjee
On Thursday 05 January 2017 06:36 PM, Greg Kroah-Hartman wrote: On Sun, Dec 18, 2016 at 10:34:31PM +, Sudip Mukherjee wrote: The variable Newblk was only being assigned some value but was never used after that. Signed-off-by: Sudip Mukherjee --- drivers/usb/storage/ene_ub6250.c | 2

[PATCH v2] USB: cypress_m8: remove unused variable

2017-01-03 Thread Sudip Mukherjee
From: Sudip Mukherjee The variable havedata was only being set but never used afterwards. Signed-off-by: Sudip Mukherjee --- v2: changed the from line drivers/usb/serial/cypress_m8.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial

Re: [PATCH] usbip: vudc: check for NULL before use

2016-12-21 Thread Sudip Mukherjee
On Wed, Dec 21, 2016 at 07:38:21AM -0700, Shuah Khan wrote: > Hi Sudip, > > On Wed, Dec 21, 2016 at 6:33 AM, Sudip Mukherjee > wrote: > > On Tue, Dec 20, 2016 at 07:31:44AM -0700, Shuah Khan wrote: > >> On 12/18/2016 03:44 PM, Sudip Mukherjee wrote: > >> >

Re: [PATCH] usbip: vudc: check for NULL before use

2016-12-21 Thread Sudip Mukherjee
On Tue, Dec 20, 2016 at 07:31:44AM -0700, Shuah Khan wrote: > On 12/18/2016 03:44 PM, Sudip Mukherjee wrote: > > to_vep() is doing a container_of() on _ep. It is better to do the NULL > > check first and then use it. > > > > Signed-off-by: Sudip Mukherjee >

[PATCH] usb: host: oxu210hp-hcd: remove unused variable

2016-12-20 Thread Sudip Mukherjee
The variable live was assigned the host controller running status but it was never used or checked after that. Signed-off-by: Sudip Mukherjee --- drivers/usb/host/oxu210hp-hcd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp

[PATCH] usbip: vudc: check for NULL before use

2016-12-18 Thread Sudip Mukherjee
to_vep() is doing a container_of() on _ep. It is better to do the NULL check first and then use it. Signed-off-by: Sudip Mukherjee --- drivers/usb/usbip/vudc_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/usbip/vudc_dev.c b/drivers/usb/usbip/vudc_dev.c

[PATCH] usb: storage: sddr09: remove unused variable

2016-12-18 Thread Sudip Mukherjee
The variable isnew was only assigned 0 or 1 but was never used after that. Signed-off-by: Sudip Mukherjee --- drivers/usb/storage/sddr09.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c index 3aeaa53..44f8ffc

[PATCH] usb: storage: ene_ub6250: remove unused variable

2016-12-18 Thread Sudip Mukherjee
The variable Newblk was only being assigned some value but was never used after that. Signed-off-by: Sudip Mukherjee --- drivers/usb/storage/ene_ub6250.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/storage/ene_ub6250.c b/drivers/usb/storage/ene_ub6250.c index 02bdaa9

[PATCH] USB: cypress_m8: remove unused variable

2016-12-18 Thread Sudip Mukherjee
The variable havedata was only being set but never used afterwards. Signed-off-by: Sudip Mukherjee --- drivers/usb/serial/cypress_m8.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index bbeeb2b..90110de 100644 --- a

[PATCH] usb: c67x00: remove unused variable

2016-12-16 Thread Sudip Mukherjee
The pointer urbp was only assigned some address but was never used. Signed-off-by: Sudip Mukherjee --- drivers/usb/c67x00/c67x00-sched.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/c67x00/c67x00-sched.c b/drivers/usb/c67x00/c67x00-sched.c index 7311ed6..0b68cd6 100644

[PATCH] usb: atm: cxacru: remove impossible condition

2016-12-16 Thread Sudip Mukherjee
The variable index is unsigned and so it can never be less than 0. Signed-off-by: Sudip Mukherjee --- drivers/usb/atm/cxacru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index f9fe86b6..d65a64c 100644 --- a/drivers/usb

[PATCH] usb: mtu3: declare functions static

2016-11-13 Thread Sudip Mukherjee
The only user of the functions mtu3_irq() and gpd_ring_empty() are in the same file. They can be declared as static. Signed-off-by: Sudip Mukherjee --- drivers/usb/mtu3/mtu3_core.c | 2 +- drivers/usb/mtu3/mtu3_qmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a

Re: [PATCH] HID: usbkbd: return proper error code

2016-09-01 Thread Sudip Mukherjee
On Thursday 01 September 2016 04:51 PM, Jiri Kosina wrote: On Wed, 31 Aug 2016, Sudip Mukherjee wrote: Use proper error code instead of using -1 on failure to allocate memory. We may use the error code later in the caller. But we don't. usb_kbd_probe() returns -ENOMEM in

Re: [PATCH] HID: usbkbd: return proper error code

2016-08-31 Thread Sudip Mukherjee
On Wednesday 31 August 2016 10:03 PM, Fabio Estevam wrote: On Wed, Aug 31, 2016 at 1:28 PM, Sudip Mukherjee wrote: Use proper error code instead of using -1 on failure to allocate memory. We may use the error code later in the caller. Signed-off-by: Sudip Mukherjee --- drivers/hid/usbhid

[PATCH] HID: usbkbd: return proper error code

2016-08-31 Thread Sudip Mukherjee
Use proper error code instead of using -1 on failure to allocate memory. We may use the error code later in the caller. Signed-off-by: Sudip Mukherjee --- drivers/hid/usbhid/usbkbd.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/hid/usbhid/usbkbd.c b

Re: USB broken on Banana Pi in Linux 4.6

2016-06-17 Thread Sudip Mukherjee
On Sun, Jun 12, 2016 at 06:47:56PM +0200, Marc Haber wrote: > On Sat, Jun 11, 2016 at 02:55:04PM +0200, Marc Haber wrote: > > On Tue, Jun 07, 2016 at 10:30:17AM -0700, Greg KH wrote: > > > Nothing obvious, can you use 'git bisect' to go from 4.5.0 to 4.6.0 to > > > find the offending commit? > > >

[PATCH] usb: usbip: remove null check

2016-06-06 Thread Sudip Mukherjee
The only caller of get_gadget_descs() has already dereferenced udc before calling this function, so udc can not be NULL at this point of the code and hence no use of checking it. Signed-off-by: Sudip Mukherjee --- drivers/usb/usbip/vudc_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [PATCH] usb: usbip: fix null pointer dereference

2016-06-06 Thread Sudip Mukherjee
On Mon, Jun 06, 2016 at 10:20:37AM +0200, Krzysztof Opasiak wrote: > > > On 06/05/2016 07:54 PM, Sudip Mukherjee wrote: > > > > Yes, I should have seen earlier that the only caller has already > > dereferenced udc. So maybe the following will be appropriate in this &

Re: [PATCH] usb: usbip: fix null pointer dereference

2016-06-05 Thread Sudip Mukherjee
On Friday 03 June 2016 09:29 AM, Krzysztof Opasiak wrote: On 06/02/2016 03:22 PM, Sudip Mukherjee wrote: We have been dereferencing udc before checking it. Lets use it after it has been checked. To be honest I have mixed feelings about this patch. On one hand it prevents us from

[PATCH] usb: usbip: fix null pointer dereference

2016-06-02 Thread Sudip Mukherjee
We have been dereferencing udc before checking it. Lets use it after it has been checked. Signed-off-by: Sudip Mukherjee --- drivers/usb/usbip/vudc_sysfs.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/vudc_sysfs.c b/drivers/usb/usbip/vudc_sysfs.c

Re: Problems with MCS7715 USB-attached parallel port

2016-06-01 Thread Sudip Mukherjee
On Tuesday 19 April 2016 10:26 PM, Alex Henrie wrote: 2016-04-19 10:44 GMT-06:00 Sudip Mukherjee : On Tuesday 19 April 2016 06:52 AM, Greg KH wrote: On Mon, Apr 18, 2016 at 06:11:51PM -0600, Alex Henrie wrote: Hi, I recently bought an MCS7715 USB-attached parallel port,[1] but there seem

[PATCH] USB: mos7720: delete parport

2016-05-30 Thread Sudip Mukherjee
re is no output as there is no registered parport. 2) Attach the device, and the command will show "parport0". 3) Remove the device and there is no output as "parport0" is now removed. 4) Attach device again to get "parport0" again. Cc: # 4.2+ Signed-off-by: Sud

[PATCH v2] usb: renesas_usbhs: fix signed-unsigned return

2016-04-30 Thread Sudip Mukherjee
The return type of usbhsp_setup_pipecfg() was u16 but it was returning a negative value (-EINVAL). Lets have an additional argument which will have pipecfg and just return the status (success or error) as the return from the function. Signed-off-by: Sudip Mukherjee --- v2: added pipecfg as an

Re: Problems with MCS7715 USB-attached parallel port

2016-04-19 Thread Sudip Mukherjee
On Tuesday 19 April 2016 10:26 PM, Alex Henrie wrote: 2016-04-19 10:44 GMT-06:00 Sudip Mukherjee : On Tuesday 19 April 2016 06:52 AM, Greg KH wrote: On Mon, Apr 18, 2016 at 06:11:51PM -0600, Alex Henrie wrote: Hi, I recently bought an MCS7715 USB-attached parallel port,[1] but there seem

Re: Problems with MCS7715 USB-attached parallel port

2016-04-19 Thread Sudip Mukherjee
On Tuesday 19 April 2016 06:52 AM, Greg KH wrote: On Mon, Apr 18, 2016 at 06:11:51PM -0600, Alex Henrie wrote: Hi, I recently bought an MCS7715 USB-attached parallel port,[1] but there seem to be a couple of problems using it with Linux: 1. The lp, parport, and parport_pc kernel modules are no

Re: [PATCH] usb: renesas_usbhs: fix signed-unsigned return

2016-04-14 Thread Sudip Mukherjee
On Thursday 14 April 2016 04:25 PM, Felipe Balbi wrote: Hi, Yoshihiro Shimoda writes: From: Sudip Mukherjee Sent: Saturday, April 09, 2016 12:05 AM The return type of usbhsp_setup_pipecfg() was u16 but it was returning a negative value (-EINVAL). Instead lets return a pointer to u16 which

[PATCH] usb: renesas_usbhs: fix signed-unsigned return

2016-04-08 Thread Sudip Mukherjee
The return type of usbhsp_setup_pipecfg() was u16 but it was returning a negative value (-EINVAL). Instead lets return a pointer to u16 which will hold the value to be returned or in case of error, return the error code in ERR_PTR. Signed-off-by: Sudip Mukherjee --- drivers/usb/renesas_usbhs

[PATCH] usb: wusbcore: remove unreachable code

2016-04-07 Thread Sudip Mukherjee
The call to wusb_dev_sysfs_rm() which is just after return will never be executed. On checking the code, wusb_dev_sysfs_add() is the last one to be executed so even if that fails we do not need wusb_dev_sysfs_rm() in the error path. Signed-off-by: Sudip Mukherjee --- drivers/usb/wusbcore

[PATCH] usb: xhci: fix build warning

2016-02-01 Thread Sudip Mukherjee
with USB_SPEED_SUPER SuperSpeed devices. Fixes: 8a1b2725a60d ("usb: define USB_SPEED_SUPER_PLUS speed for SuperSpeedPlus USB3.1 devices") Cc: Mathias Nyman Signed-off-by: Sudip Mukherjee --- drivers/usb/host/xhci.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH] usb: gadget: fix error handling

2016-01-07 Thread Sudip Mukherjee
We are doing PTR_ERR() of NULL, and that will actually make ret = 0. So incase of both error and success we are actually returning the success code. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/composite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

Re: [PATCH 2/3] usb: gadget: at91_udc: mention proper dependency

2015-10-01 Thread Sudip Mukherjee
On Wed, Sep 30, 2015 at 06:34:28PM +0200, Nicolas Ferre wrote: > Le 30/09/2015 18:24, Sudip Mukherjee a écrit : > > On Wed, Sep 30, 2015 at 11:04:54AM -0500, Felipe Balbi wrote: > >> On Wed, Sep 23, 2015 at 09:22:48PM +0530, Sudip Mukherjee wrote: > >>> On Mon, Se

Re: [PATCH 2/3] usb: gadget: at91_udc: mention proper dependency

2015-10-01 Thread Sudip Mukherjee
On Wed, Sep 30, 2015 at 07:12:18PM +0200, Nicolas Ferre wrote: > > > Sorry that I missed ccing you while sending the patch. We should not > > always depend on getmaintainer.pl. > > Well, I'm marked as maintainer for this drivers actually and > get_maintainer.pl shouldn't lie this time... For th

Re: [PATCH 2/3] usb: gadget: at91_udc: mention proper dependency

2015-09-30 Thread Sudip Mukherjee
On Wed, Sep 30, 2015 at 06:34:28PM +0200, Nicolas Ferre wrote: > Le 30/09/2015 18:24, Sudip Mukherjee a écrit : > > On Wed, Sep 30, 2015 at 11:04:54AM -0500, Felipe Balbi wrote: > >> On Wed, Sep 23, 2015 at 09:22:48PM +0530, Sudip Mukherjee wrote: > >>> On Mon, Se

Re: [PATCH 2/3] usb: gadget: at91_udc: mention proper dependency

2015-09-30 Thread Sudip Mukherjee
On Wed, Sep 30, 2015 at 11:04:54AM -0500, Felipe Balbi wrote: > On Wed, Sep 23, 2015 at 09:22:48PM +0530, Sudip Mukherjee wrote: > > On Mon, Sep 21, 2015 at 04:40:57PM +0530, Sudip Mukherjee wrote: > > > On Sun, Sep 20, 2015 at 11:15:28AM -0500, Felipe Balbi wrote: > > >

Re: [PATCH v2 02/12] usb: gadget: amd5536udc: fix error path

2015-09-30 Thread Sudip Mukherjee
On Tue, Sep 22, 2015 at 10:19:46AM -0500, Felipe Balbi wrote: > On Tue, Sep 22, 2015 at 08:29:52PM +0530, Sudip Mukherjee wrote: > > On Tue, Sep 22, 2015 at 08:12:29PM +0530, Sudip Mukherjee wrote: > > > On Tue, Sep 22, 2015 at 09:37:45AM -0500, Felipe Balbi wrote: > > >

Re: [PATCH] HID: hiddev: fix returned errno code in hiddev_connect()

2015-09-30 Thread Sudip Mukherjee
On Wed, Sep 30, 2015 at 10:56:26AM +0100, Luis de Bethencourt wrote: > On 30/09/15 10:52, Luis de Bethencourt wrote: > > The driver is using -1 instead of the -ENOMEM defined macro to specify > > that a buffer allocation failed. Since the error number is propagated, > > the caller will get a -EPERM

[PATCH] usb: gadget: bdc: fix memory leak

2015-09-26 Thread Sudip Mukherjee
If dma_pool_alloc() fails we are jumping to fail and releasing all the bd_tables which have been added to the chain but we missed freeing this bd_table which was just allocated and still not added to the chain of bd_table. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/bdc/bdc_ep.c

Re: [PATCH 3/3] page-flags: rectify forward declaration

2015-09-24 Thread Sudip Mukherjee
> > > > Also, I'm finding that the patch series introduces a pretty large > > bisection hole: > > > > include/linux/page-flags.h: In function 'PageYoung': > > include/linux/page-flags.h:327: error: implicit declaration of function > > 'PF_ANY' > > include/linux/page-flags.h:327: error: invalid t

Re: [PATCH 1/3] avr32: fix build failure

2015-09-24 Thread Sudip Mukherjee
On Wed, Sep 23, 2015 at 07:15:16PM +0200, Hans-Christian Egtvedt wrote: > Around Wed 23 Sep 2015 21:26:01 +0530 or thereabout, Sudip Mukherjee wrote: > > On Mon, Sep 21, 2015 at 01:31:44PM +0530, Sudip Mukherjee wrote: > >> On Mon, Sep 21, 2015 at 09:33:00AM +0200, Hans-Chris

Re: [PATCH 1/3] avr32: fix build failure

2015-09-23 Thread Sudip Mukherjee
On Mon, Sep 21, 2015 at 01:31:44PM +0530, Sudip Mukherjee wrote: > On Mon, Sep 21, 2015 at 09:33:00AM +0200, Hans-Christian Egtvedt wrote: > > Around Mon 21 Sep 2015 12:09:01 +0530 or thereabout, Sudip Mukherjee wrote: > > > On Mon, Sep 21, 2015 at 08:09:42AM +0200, Hans-Chris

Re: [PATCH 2/3] usb: gadget: at91_udc: mention proper dependency

2015-09-23 Thread Sudip Mukherjee
On Mon, Sep 21, 2015 at 04:40:57PM +0530, Sudip Mukherjee wrote: > On Sun, Sep 20, 2015 at 11:15:28AM -0500, Felipe Balbi wrote: > > On Sat, Sep 19, 2015 at 10:42:58PM +0530, Sudip Mukherjee wrote: > > > While building allmodconfig on avr32 the build failed with the error: &g

Re: [PATCH v2 02/12] usb: gadget: amd5536udc: fix error path

2015-09-22 Thread Sudip Mukherjee
On Tue, Sep 22, 2015 at 10:19:46AM -0500, Felipe Balbi wrote: > On Tue, Sep 22, 2015 at 08:29:52PM +0530, Sudip Mukherjee wrote: > > On Tue, Sep 22, 2015 at 08:12:29PM +0530, Sudip Mukherjee wrote: > > > On Tue, Sep 22, 2015 at 09:37:45AM -0500, Felipe Balbi wrote: > > >

Re: [PATCH v2 02/12] usb: gadget: amd5536udc: fix error path

2015-09-22 Thread Sudip Mukherjee
On Tue, Sep 22, 2015 at 08:12:29PM +0530, Sudip Mukherjee wrote: > On Tue, Sep 22, 2015 at 09:37:45AM -0500, Felipe Balbi wrote: > > On Tue, Sep 22, 2015 at 06:54:27PM +0530, Sudip Mukherjee wrote: > > > Handle the error properly instead of calling the pci remove function. >

Re: [PATCH v2 02/12] usb: gadget: amd5536udc: fix error path

2015-09-22 Thread Sudip Mukherjee
On Tue, Sep 22, 2015 at 09:37:45AM -0500, Felipe Balbi wrote: > On Tue, Sep 22, 2015 at 06:54:27PM +0530, Sudip Mukherjee wrote: > > Handle the error properly instead of calling the pci remove function. > > > > Signed-off-by: Sudip Mukherjee > > this doesn't

[PATCH v2 00/12] usb: gadget: amd5536udc: fix memory leaks

2015-09-22 Thread Sudip Mukherjee
Proper error handling was done in the probe and some unwanted comparison was removed. Also some forward declaration was removed. regards sudip Sudip Mukherjee (12): usb: gadget: amd5536udc: rewrite init_dma_pools usb: gadget: amd5536udc: fix error path usb: gadget: amd5536udc: use WARN_ON

[PATCH v2 05/12] usb: gadget: amd5536udc: remove unnecessary conditions

2015-09-22 Thread Sudip Mukherjee
the error handler of probe function. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 17 + drivers/usb/gadget/udc/amd5536udc.h | 5 + 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb

[PATCH v2 01/12] usb: gadget: amd5536udc: rewrite init_dma_pools

2015-09-22 Thread Sudip Mukherjee
A rewrite of init_dma_pools() with proper error handling. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c

[PATCH v2 02/12] usb: gadget: amd5536udc: fix error path

2015-09-22 Thread Sudip Mukherjee
Handle the error properly instead of calling the pci remove function. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 29 ++--- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb

[PATCH v2 07/12] usb: gadget: amd5536udc: remove forward declaration of udc_remote_wakeup

2015-09-22 Thread Sudip Mukherjee
Rearrange the udc_remote_wakeup function to remove the forward declaration. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 41 ++--- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b

[PATCH v2 04/12] usb: gadget: amd5536udc: use free_dma_pools

2015-09-22 Thread Sudip Mukherjee
successfully allocated, so they cannot be NULL here. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c index 6223b1b

[PATCH v2 06/12] usb: gadget: amd5536udc: remove forward declaration of udc_probe

2015-09-22 Thread Sudip Mukherjee
Rearrange the udc_probe function to remove the forward declarations. While rearranging also fixed the relevant checkpatch warnings. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 133 ++-- 1 file changed, 66 insertions(+), 67 deletions

[PATCH v2 03/12] usb: gadget: amd5536udc: use WARN_ON

2015-09-22 Thread Sudip Mukherjee
Use WARN_ON() instead of halting the kernel with BUG_ON() and also fix the checkpatch warning. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget

[PATCH v2 08/12] usb: gadget: amd5536udc: remove forward declaration of udc_create_dma_chain

2015-09-22 Thread Sudip Mukherjee
Rearrange udc_create_dma_chain to remove the forward declaration. While rearranging fixed the relevant checkpatch warnings. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 238 ++-- 1 file changed, 117 insertions(+), 121 deletions

[PATCH v2 10/12] usb: gadget: amd5536udc: remove forward declaration of udc_pci_*

2015-09-22 Thread Sudip Mukherjee
Remove the forward declarations of udc_pci_probe and udc_pci_remove. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c index 6d64129..00ae069

[PATCH v2 12/12] usb: gadget: amd5536udc: NULL comparison

2015-09-22 Thread Sudip Mukherjee
A NULL comparison can be written as if (var) or if (!var). Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c index 157bff1

[PATCH v2 11/12] usb: gadget: amd5536udc: remove forward declaration of udc_basic_init

2015-09-22 Thread Sudip Mukherjee
Rearrange the udc_basic_init function to remove the forward declaration. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 55 ++--- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b

[PATCH v2 09/12] usb: gadget: amd5536udc: remove forward declaration of udc_free_dma_chain

2015-09-22 Thread Sudip Mukherjee
Rearrange udc_free_dma_chain to remove the forward declaration. While at it fixed all the relevant checkpatch warnings. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 51 + 1 file changed, 24 insertions(+), 27 deletions(-) diff

Re: [PATCH 3/3] page-flags: rectify forward declaration

2015-09-22 Thread Sudip Mukherjee
On Mon, Sep 21, 2015 at 03:35:09PM -0700, Andrew Morton wrote: > On Sat, 19 Sep 2015 22:42:59 +0530 Sudip Mukherjee > wrote: > > > Is it fixable? Can we use the traditional define-before-using structure? How about this: diff --git a/include/linux/page-flags.h b/include/lin

Re: [PATCH 00/16] usb: gadget: amd5536udc: fix memory leaks

2015-09-21 Thread Sudip Mukherjee
On Sun, Sep 20, 2015 at 11:17:36AM -0500, Felipe Balbi wrote: > On Sun, Sep 20, 2015 at 01:42:42PM +0530, Sudip Mukherjee wrote: > > On Sat, Sep 19, 2015 at 09:24:38AM +0530, Sudip Mukherjee wrote: > > > On Fri, Sep 18, 2015 at 01:39:54PM -0500, Felipe Balbi wrote: > > >

Re: [PATCH 2/3] usb: gadget: at91_udc: mention proper dependency

2015-09-21 Thread Sudip Mukherjee
On Sun, Sep 20, 2015 at 11:15:28AM -0500, Felipe Balbi wrote: > On Sat, Sep 19, 2015 at 10:42:58PM +0530, Sudip Mukherjee wrote: > > While building allmodconfig on avr32 the build failed with the error: > > "at91_pmc_base" [drivers/usb/gadget/udc/atmel_usba_udc.ko] undefi

Re: [PATCH 1/3] avr32: fix build failure

2015-09-21 Thread Sudip Mukherjee
On Mon, Sep 21, 2015 at 09:33:00AM +0200, Hans-Christian Egtvedt wrote: > Around Mon 21 Sep 2015 12:09:01 +0530 or thereabout, Sudip Mukherjee wrote: > > On Mon, Sep 21, 2015 at 08:09:42AM +0200, Hans-Christian Egtvedt wrote: > >> Around Sat 19 Sep 2015 22:42:57 +0530 or

Re: [PATCH 1/3] avr32: fix build failure

2015-09-20 Thread Sudip Mukherjee
On Mon, Sep 21, 2015 at 08:09:42AM +0200, Hans-Christian Egtvedt wrote: > Around Sat 19 Sep 2015 22:42:57 +0530 or thereabout, Sudip Mukherjee wrote: > > While building avr32 with allmodconfig, the build used to fail with the > > message: > > error: implicit declaration o

Re: [PATCH] USB: EHCI: fix dereference of ERR_PTR

2015-09-20 Thread Sudip Mukherjee
On Mon, Sep 21, 2015 at 10:48:52AM +0800, Lu, Baolu wrote: > > > On 09/16/2015 10:08 PM, Sudip Mukherjee wrote: > >On error find_tt() returns either a NULL pointer or the error value in > >ERR_PTR. But we were dereferencing it directly without even checking if > >

Re: [PATCH 00/16] usb: gadget: amd5536udc: fix memory leaks

2015-09-20 Thread Sudip Mukherjee
On Sat, Sep 19, 2015 at 09:24:38AM +0530, Sudip Mukherjee wrote: > On Fri, Sep 18, 2015 at 01:39:54PM -0500, Felipe Balbi wrote: > > On Mon, Sep 14, 2015 at 08:42:47PM +0530, Sudip Mukherjee wrote: > > > This amd5536udc was a complete mess. The major problems that i co

[PATCH 3/3] page-flags: rectify forward declaration

2015-09-19 Thread Sudip Mukherjee
eclared inline after being called. warning: previous declaration of 'compound_head' was here Signed-off-by: Sudip Mukherjee --- tested build with avr32 and also with x86_64 allmodconfig to verify that nothing breaks due to this change. include/linux/page-flags.h | 2 +- 1 file chang

[PATCH 1/3] avr32: fix build failure

2015-09-19 Thread Sudip Mukherjee
While building avr32 with allmodconfig, the build used to fail with the message: error: implicit declaration of function 'pci_iomap' error: implicit declaration of function 'pci_iounmap' Create dummy pci_io{map,unmap} functions to fix the build. Signed-off-by: Sudip Mukherj

[PATCH 2/3] usb: gadget: at91_udc: mention proper dependency

2015-09-19 Thread Sudip Mukherjee
LK_AT91 is defined we donot have at91_pmc_base. And COMMON_CLK_AT91 is available with AT91 architecture. Mention the dependency such that this driver builds with avr32 only if OF is not enabled. Signed-off-by: Sudip Mukherjee --- Tested build with at91_dt_defconfig and allmodconfig of avr32. Bu

[PATCH 0/3] fix allmodconfig failure of avr32

2015-09-19 Thread Sudip Mukherjee
ixes these two problems. Third patch is related to a build warning: warning: 'compound_head' declared inline after being called. warning: previous declaration of 'compound_head' was here. regards sudip Sudip Mukherjee (3): avr32: fix build failure usb: gadget: at91_udc: menti

Re: First kernel patch (optimization)

2015-09-18 Thread Sudip Mukherjee
On Fri, Sep 18, 2015 at 10:26:24PM -0400, Theodore Ts'o wrote: > On Fri, Sep 18, 2015 at 12:42:48AM -0700, Greg KH wrote: > > Rather, what concerns me is that we aren't pushing people to go > *beyond* cleanup patches. We have lots of tutorials about how to > create perfectly formed patches; but we

Re: [PATCH 00/16] usb: gadget: amd5536udc: fix memory leaks

2015-09-18 Thread Sudip Mukherjee
On Fri, Sep 18, 2015 at 01:39:54PM -0500, Felipe Balbi wrote: > On Mon, Sep 14, 2015 at 08:42:47PM +0530, Sudip Mukherjee wrote: > > This amd5536udc was a complete mess. The major problems that i could > > find are: > > > > 1) if udc_pci_probe() fails in any s

Re: [PATCH v2] USB: EHCI: fix dereference of ERR_PTR

2015-09-17 Thread Sudip Mukherjee
On Wed, Sep 16, 2015 at 12:54:03PM -0400, Alan Stern wrote: > On Wed, 16 Sep 2015, Sudip Mukherjee wrote: > > > On error find_tt() returns either a NULL pointer or the error value in > > ERR_PTR. But we were dereferencing it directly without even checking if > > find_tt()

[PATCH v2] USB: EHCI: fix dereference of ERR_PTR

2015-09-16 Thread Sudip Mukherjee
On error find_tt() returns either a NULL pointer or the error value in ERR_PTR. But we were dereferencing it directly without even checking if find_tt() returned a valid pointer or not. Signed-off-by: Sudip Mukherjee --- v2: used IS_ERR_OR_NULL (didn't know it was there. thanks) driver

[PATCH] USB: EHCI: fix dereference of ERR_PTR

2015-09-16 Thread Sudip Mukherjee
On error find_tt() returns either a NULL pointer or the error value in ERR_PTR. But we were dereferencing it directly without even checking if find_tt() returned a valid pointer or not. Signed-off-by: Sudip Mukherjee --- drivers/usb/host/ehci-sched.c | 4 1 file changed, 4 insertions

[PATCH 04/16] usb: gadget: amd5536udc: use WARN_ON

2015-09-14 Thread Sudip Mukherjee
Use WARN_ON() instead of halting the kernel with BUG_ON(). Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c index 8646f6c

[PATCH 02/16] usb: gadget: amd5536udc: rewrite init_dma_pools

2015-09-14 Thread Sudip Mukherjee
A rewrite of init_dma_pools() with proper error handling. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c

[PATCH 07/16] usb: gadget: amd5536udc: unmap virt_addr

2015-09-14 Thread Sudip Mukherjee
We have actually ioremapped dev->virt_addr and dev->regs is dev->virt_addr + UDC_DEVCFG_ADDR so while unmapping we should unmap dev->virt_addr. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH 00/16] usb: gadget: amd5536udc: fix memory leaks

2015-09-14 Thread Sudip Mukherjee
remove() for error handling and udc_pci_remove() will inturn halts the kernel by calling BUG(). And apart from these numerous memory leaks and not releasing of resources. Here comes a rewrite of few of the functions in an attempt to fix these. regards sudip Sudip Mukherjee (16): usb:

[PATCH 06/16] usb: gadget: amd5536udc: remove unnecessary conditions

2015-09-14 Thread Sudip Mukherjee
the error handler of probe function. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c index 3ae0bb8..e2f6128 100644

[PATCH 08/16] usb: gadget: amd5536udc: remove forward declaration of udc_probe

2015-09-14 Thread Sudip Mukherjee
Rearrange the udc_probe function to remove the forward declarations. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 133 ++-- 1 file changed, 66 insertions(+), 67 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers

[PATCH 05/16] usb: gadget: amd5536udc: use free_dma_pools

2015-09-14 Thread Sudip Mukherjee
successfully allocated, so they cannot be NULL here. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c index 4edcfd4

[PATCH 03/16] usb: gadget: amd5536udc: rewrite udc_pci_probe

2015-09-14 Thread Sudip Mukherjee
A rewrite of udc_pci_probe() with proper error handling. We use here free_dma_pools() in error handling. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 52 +++-- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/drivers/usb

[PATCH 12/16] usb: gadget: amd5536udc: remove forward declaration of udc_pci_*

2015-09-14 Thread Sudip Mukherjee
Remove the forward declarations of udc_pci_probe and udc_pci_remove. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c index 778a424..789441f

[PATCH 10/16] usb: gadget: amd5536udc: remove forward declaration of udc_create_dma_chain

2015-09-14 Thread Sudip Mukherjee
Rearrange udc_create_dma_chain to remove the forward declaration. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 241 ++-- 1 file changed, 119 insertions(+), 122 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers

[PATCH 09/16] usb: gadget: amd5536udc: remove forward declaration of udc_remote_wakeup

2015-09-14 Thread Sudip Mukherjee
Rearrange the udc_remote_wakeup function to remove the forward declaration. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 40 ++--- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b

[PATCH 11/16] usb: gadget: amd5536udc: remove forward declaration of udc_free_dma_chain

2015-09-14 Thread Sudip Mukherjee
Rearrange udc_free_dma_chain to remove the forward declaration. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 53 ++--- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb

[PATCH 15/16] usb: gadget: amd5536udc: remove multiple blank lines

2015-09-14 Thread Sudip Mukherjee
checkpatch complains about multiple blank lines. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 13 - 1 file changed, 13 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c index 3657a66..98b841d 100644

[PATCH 13/16] usb: gadget: amd5536udc: remove forward declaration of udc_basic_init

2015-09-14 Thread Sudip Mukherjee
Rearrange the udc_basic_init function to remove the forward declaration. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 55 ++--- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b

[PATCH 16/16] usb: gadget: amd5536udc: match alignment

2015-09-14 Thread Sudip Mukherjee
checkpatch complains that the alignment should match with open parenthesis. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 156 ++-- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b

[PATCH 14/16] usb: gadget: amd5536udc: NULL comparison

2015-09-14 Thread Sudip Mukherjee
A NULL comparison can be written as if (var) or if (!var). Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c index

[PATCH 01/16] usb: gadget: amd5536udc: introduce free_dma_pools

2015-09-14 Thread Sudip Mukherjee
dma pools are being created by init_dma_pools() but there was no function for freeing them. Introduce the function now so that we can use it later. Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/amd5536udc.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb

Re: [PATCH] usb: gadget: amd5536udc: fix NULL pointer dereference

2015-09-11 Thread Sudip Mukherjee
On Fri, Sep 11, 2015 at 08:28:34AM -0500, Felipe Balbi wrote: > Hi, > > On Fri, Sep 11, 2015 at 03:32:56PM +0530, Sudip Mukherjee wrote: > > On Thu, Sep 10, 2015 at 11:03:34AM -0700, David Cohen wrote: > no, the check is pointless. Most of these are. Just look at your probe(

  1   2   >