]> asedeno.scripts.mit.edu Git - linux.git/commit
Input: gtco - fix usb_dev leak
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Mon, 27 Jan 2014 20:25:47 +0000 (12:25 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 28 Jan 2014 06:34:49 +0000 (22:34 -0800)
commit1f906f8376c2d53dca347b15c0caef71d91087b4
treedfe8e493d0adad819031e098717c6b903c5638b8
parent11601a82d569267b016f808393bb8c26f855a7ea
Input: gtco - fix usb_dev leak

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 (in our case gtco) which will destroy gtco
memory. Taking additional reference is not needed here.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/tablet/gtco.c