summaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/legousbtower.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2020-12-08 17:30:42 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-08 19:55:09 +0100
commitb175d273d4e4100b66e68f0675fef7a3c07a7957 (patch)
treedd9662c7e7015e497fdd851a5b60811c39b9e369 /drivers/usb/misc/legousbtower.c
parentMerge tag 'thunderbolt-for-v5.11-rc1' of git://git.kernel.org/pub/scm/linux/k... (diff)
downloadlinux-b175d273d4e4100b66e68f0675fef7a3c07a7957.tar.xz
linux-b175d273d4e4100b66e68f0675fef7a3c07a7957.zip
USB: legotower: fix logical error in recent commit
Commit d9f0d82f06c6 ("USB: legousbtower: use usb_control_msg_recv()") contained an elementary logical error. The check of the return code from the new usb_control_msg_recv() function was inverted. Reported-and-tested-by: syzbot+9be25235b7a69b24d117@syzkaller.appspotmail.com Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Link: https://lore.kernel.org/r/20201208163042.GD1298255@rowland.harvard.edu Fixes: d9f0d82f06c6 ("USB: legousbtower: use usb_control_msg_recv()") Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc/legousbtower.c')
-rw-r--r--drivers/usb/misc/legousbtower.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index ba655b4af4fc..1c9e09138c10 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -797,7 +797,7 @@ static int tower_probe(struct usb_interface *interface, const struct usb_device_
&get_version_reply,
sizeof(get_version_reply),
1000, GFP_KERNEL);
- if (!result) {
+ if (result) {
dev_err(idev, "get version request failed: %d\n", result);
retval = result;
goto error;