lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1480828209-4131-1-git-send-email-bianpan201603@163.com>
Date:   Sun,  4 Dec 2016 13:10:09 +0800
From:   Pan Bian <bianpan201603@....com>
To:     Jiri Kosina <jikos@...nel.org>,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        linux-usb@...r.kernel.org, linux-input@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, Pan Bian <bianpan2016@....com>
Subject: [PATCH 1/1] input: usbhid: fix improper check

From: Pan Bian <bianpan2016@....com>

Function hid_post_reset() returns 0 on success, or 1 on failures.
However, in function hid_reset_resume(), uses "status >= 0" to check the
return value of hid_post_reset(). Obviously, the condition will always
be satisfied. This patch fixes the bug, uses "status == 0" to check the
return value.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188921

Signed-off-by: Pan Bian <bianpan2016@....com>
---
 drivers/hid/usbhid/hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index ae83af6..3639b70 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -1590,7 +1590,7 @@ static int hid_reset_resume(struct usb_interface *intf)
 	int status;
 
 	status = hid_post_reset(intf);
-	if (status >= 0 && hid->driver && hid->driver->reset_resume) {
+	if (status == 0 && hid->driver && hid->driver->reset_resume) {
 		int ret = hid->driver->reset_resume(hid);
 		if (ret < 0)
 			status = ret;
-- 
1.9.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ