]> git.baikalelectronics.ru Git - kernel.git/commit
USB: usbtmc: fix probe error path
authorJohan Hovold <johan@kernel.org>
Tue, 14 Mar 2017 16:55:46 +0000 (17:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2017 04:22:58 +0000 (13:22 +0900)
commit8a14e126799610d7e076e1e18ab1ff5a490b1d78
tree5f5ee146e1e527a37817d5b22a168c4ef7e4bc92
parenta19c5c356f5d2b8ed72d349dbe31b4f994916662
USB: usbtmc: fix probe error path

Make sure to initialise the return value to avoid having allocation
failures going unnoticed when allocating interrupt-endpoint resources.

This prevents use-after-free or worse when the device is later unbound.

Fixes: af584e432629 ("Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.")
Cc: stable <stable@vger.kernel.org> # 4.6
Cc: Dave Penkler <dpenkler@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/usbtmc.c