From: Thomas Meyer <thomas@m3y3r.de>
To: kys@microsoft.com, haiyangz@microsoft.com, jkosina@suse.cz,
devel@linuxdriverproject.org, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] HID: hyperv: Cocci spatch "memdup.spatch"
Date: Sat, 01 Jun 2013 11:40:31 +0200 [thread overview]
Message-ID: <1370079631.29224.9.camel@localhost.localdomain> (raw)
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
diff -u -p a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
--- a/drivers/hid/hid-hyperv.c
+++ b/drivers/hid/hid-hyperv.c
@@ -199,13 +199,11 @@ static void mousevsc_on_receive_device_i
if (desc->bLength == 0)
goto cleanup;
- input_device->hid_desc = kzalloc(desc->bLength, GFP_ATOMIC);
+ input_device->hid_desc = kmemdup(desc, desc->bLength, GFP_ATOMIC);
if (!input_device->hid_desc)
goto cleanup;
- memcpy(input_device->hid_desc, desc, desc->bLength);
-
input_device->report_desc_size = desc->desc[0].wDescriptorLength;
if (input_device->report_desc_size == 0) {
input_device->dev_info_status = -EINVAL;
next reply other threads:[~2013-06-01 9:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-01 9:40 Thomas Meyer [this message]
2013-06-03 11:34 ` [PATCH] HID: hyperv: Cocci spatch "memdup.spatch" Jiri Kosina
2013-06-03 14:14 ` KY Srinivasan
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=1370079631.29224.9.camel@localhost.localdomain \
--to=thomas@m3y3r.de \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=jkosina@suse.cz \
--cc=kys@microsoft.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).