]> git.ipfire.org Git - thirdparty/kernel/stable.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>
Thu, 30 Mar 2017 07:44:05 +0000 (09:44 +0200)
commitbb486e80a13f0f4d61b9256b58aa33b9cf57d3f3
tree2d0a26fe81afa7e807efa14a9edfde97aa82a256
parentad1bbccdf018396c3b469d0fea29aaae81b9ae09
USB: usbtmc: fix probe error path

commit 2e47c53503eb9faff42b3cfa144a833344dd1f89 upstream.

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: dbf3e7f654c0 ("Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.")
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