Re: [PATCH] USB: input: gtco.c: fix usb_dev leak

2014-01-27 Thread Dmitry Torokhov
On Tue, Jan 28, 2014 at 12:10:54AM +0400, Alexey Khoroshilov wrote: > There is usb_get_dev() in gtco_probe(), but there is no usb_put_dev() > anywhere in the driver. > > As pointed out by Dmitry Torokhov: > The lifetime of gtco structure is already directly tied to lifetime of > usb_dev: when dest

[PATCH] USB: input: gtco.c: fix usb_dev leak

2014-01-27 Thread Alexey Khoroshilov
There is usb_get_dev() in gtco_probe(), but there is no usb_put_dev() anywhere in the driver. As pointed out by Dmitry Torokhov: The lifetime of gtco structure is already directly tied to lifetime of usb_dev: when destroying usb_dev driver core will call remove() function of currently bound driver

Re: [PATCH] USB: input: gtco.c: fix usb_dev leak

2014-01-27 Thread Greg Kroah-Hartman
On Mon, Jan 27, 2014 at 02:29:23PM +0400, Alexey Khoroshilov wrote: > On 27.01.2014 10:54, Dmitry Torokhov wrote: > > Hi Alexey, > > > > On Mon, Jan 27, 2014 at 10:31:36AM +0400, Alexey Khoroshilov wrote: > >> On 21.01.2014 23:59, Dmitry Torokhov wrote: > >>> On Sun, Jan 19, 2014 at 03:24:26AM +040

Re: [PATCH] USB: input: gtco.c: fix usb_dev leak

2014-01-27 Thread Alexey Khoroshilov
On 27.01.2014 10:54, Dmitry Torokhov wrote: > Hi Alexey, > > On Mon, Jan 27, 2014 at 10:31:36AM +0400, Alexey Khoroshilov wrote: >> On 21.01.2014 23:59, Dmitry Torokhov wrote: >>> On Sun, Jan 19, 2014 at 03:24:26AM +0400, Alexey Khoroshilov wrote: There is usb_get_dev() in gtco_probe(), but th

Re: [PATCH] USB: input: gtco.c: fix usb_dev leak

2014-01-26 Thread Dmitry Torokhov
Hi Alexey, On Mon, Jan 27, 2014 at 10:31:36AM +0400, Alexey Khoroshilov wrote: > On 21.01.2014 23:59, Dmitry Torokhov wrote: > > On Sun, Jan 19, 2014 at 03:24:26AM +0400, Alexey Khoroshilov wrote: > >> There is usb_get_dev() in gtco_probe(), but there is no usb_put_dev() > >> anywhere in the drive

Re: [PATCH] USB: input: gtco.c: fix usb_dev leak

2014-01-26 Thread Alexey Khoroshilov
On 21.01.2014 23:59, Dmitry Torokhov wrote: > On Sun, Jan 19, 2014 at 03:24:26AM +0400, Alexey Khoroshilov wrote: >> There is usb_get_dev() in gtco_probe(), but there is no usb_put_dev() >> anywhere in the driver. >> >> The patch adds usb_get_dev() to failure handling code of gtco_probe() >> and to

Re: [PATCH] USB: input: gtco.c: fix usb_dev leak

2014-01-21 Thread Dmitry Torokhov
On Sun, Jan 19, 2014 at 03:24:26AM +0400, Alexey Khoroshilov wrote: > There is usb_get_dev() in gtco_probe(), but there is no usb_put_dev() > anywhere in the driver. > > The patch adds usb_get_dev() to failure handling code of gtco_probe() > and to gtco_disconnect((). Hmm, I think gtco should sim

[PATCH] USB: input: gtco.c: fix usb_dev leak

2014-01-18 Thread Alexey Khoroshilov
There is usb_get_dev() in gtco_probe(), but there is no usb_put_dev() anywhere in the driver. The patch adds usb_get_dev() to failure handling code of gtco_probe() and to gtco_disconnect((). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- dr