From: Dan Carpenter <dan.carpenter@oracle.com>
To: Joseph Salisbury <joseph.salisbury@canonical.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
list@osuosl.org, Haiyang Zhang <haiyangz@microsoft.com>,
LKML <linux-kernel@vger.kernel.org>,
open@osuosl.org, HID CORE LAYER <linux-input@vger.kernel.org>,
devel@linuxdriverproject.org, thomas@m3y3r.de
Subject: Re: [v3.11][Regression] HID: hyperv: convert alloc+memcpy to memdup
Date: Fri, 27 Sep 2013 18:59:41 +0300 [thread overview]
Message-ID: <20130927155941.GG6247@mwanda> (raw)
In-Reply-To: <20130927152412.GF6192@mwanda>
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);
next prev parent reply other threads:[~2013-09-27 16:00 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-16 17:42 [v3.11][Regression] HID: hyperv: convert alloc+memcpy to memdup Joseph Salisbury
2013-09-16 20:38 ` Dan Carpenter
2013-09-16 20:49 ` Joseph Salisbury
2013-09-16 21:05 ` Dan Carpenter
2013-09-17 0:44 ` Joseph Salisbury
2013-09-24 9:29 ` Jiri Kosina
2013-09-24 13:52 ` Joseph Salisbury
2013-09-24 18:25 ` Joseph Salisbury
2013-09-25 17:45 ` Joseph Salisbury
2013-09-27 10:50 ` Jiri Kosina
2013-09-27 14:42 ` Joseph Salisbury
2013-09-27 15:24 ` Dan Carpenter
2013-09-27 15:59 ` Dan Carpenter [this message]
2013-09-30 14:35 ` Jiri Kosina
2013-09-30 14:59 ` Dan Carpenter
2013-12-16 13:01 ` Jiri Kosina
2013-12-19 9:55 ` David Herrmann
2013-12-19 9:59 ` Jiri Kosina
2013-12-19 10:08 ` David Herrmann
2013-12-19 11:22 ` David Herrmann
2013-12-19 12:59 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130927155941.GG6247@mwanda \
--to=dan.carpenter@oracle.com \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=jkosina@suse.cz \
--cc=joseph.salisbury@canonical.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=list@osuosl.org \
--cc=open@osuosl.org \
--cc=thomas@m3y3r.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).