Input: pxrc - fix freeing URB on device teardown
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 18 Jul 2018 18:03:36 +0000 (18:03 +0000)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 25 Jul 2018 19:04:15 +0000 (19:04 +0000)
commit34dad2cf1104869ce2db2bddb34f8e6780c2ddaa
treebb117a473c186aa8263dc44a0459cf4ae9b7defc
parent9730f60888d4b35be0f2d7316cb9e227d071cdda
Input: pxrc - fix freeing URB on device teardown

URB is the only resource that is not managed, and thus is destroyed too early,
before we unregister input device and stop URB in pxrc_close(). To fix it let's
install custom devm handler to free the URB at the right time in devm unwind
sequence.

Reviewed-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Tested-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/joystick/pxrc.c