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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130927155941.GG6247@mwanda>
Date:	Fri, 27 Sep 2013 18:59:41 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Joseph Salisbury <joseph.salisbury@...onical.com>
Cc:	Jiri Kosina <jkosina@...e.cz>, list@...osl.org,
	Haiyang Zhang <haiyangz@...rosoft.com>,
	LKML <linux-kernel@...r.kernel.org>, open@...osl.org,
	HID CORE LAYER <linux-input@...r.kernel.org>,
	devel@...uxdriverproject.org, thomas@...3r.de
Subject: Re: [v3.11][Regression] HID: hyperv: convert alloc+memcpy to memdup

On Fri, Sep 27, 2013 at 06:24:12PM +0300, Dan Carpenter wrote:
> 
> It looks like magicmouse_raw_event() returns 1 on success and 0 on
> failure.

Fixing the return codes is a good idea but it won't fix the oops.

What's the point of returning 1 and 0?  In the current code no one
cares and both are treated the same.

Also if we decide to fix this instead of reverting the we could do this
cleanup as well:

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index b8470b1..868ebaa 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1417,10 +1417,8 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
 
 	if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) {
 		ret = hdrv->raw_event(hid, report, data, size);
-		if (ret < 0) {
-			ret = ret < 0 ? ret : 0;
+		if (ret < 0)
 			goto unlock;
-		}
 	}
 
 	ret = hid_report_raw_event(hid, type, data, size, interrupt);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ