summaryrefslogtreecommitdiffstats
path: root/drivers/hid/i2c-hid/i2c-hid.c
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-02-01 23:23:10 -0500
committerJiri Kosina <jkosina@suse.cz>2014-02-03 11:02:01 +0100
commit9d27f43274e4889249dc42ca1a3989dd75c5edaf (patch)
tree0b99ca52dc1667f999f5c7288bccb1eff6bfb6c2 /drivers/hid/i2c-hid/i2c-hid.c
parent3db187e7bf76ace626664ef80afbc2e1501172c6 (diff)
downloadlinux-9d27f43274e4889249dc42ca1a3989dd75c5edaf.tar.bz2
HID: fix buffer allocations
When using hid_output_report(), the buffer should be allocated by hid_alloc_report_buf(), not a custom malloc. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/i2c-hid/i2c-hid.c')
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index e914f2755491..ce68a120ba26 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -582,7 +582,7 @@ static void i2c_hid_request(struct hid_device *hid, struct hid_report *rep,
int ret;
int len = i2c_hid_get_report_length(rep) - 2;
- buf = kzalloc(len, GFP_KERNEL);
+ buf = hid_alloc_report_buf(rep, GFP_KERNEL);
if (!buf)
return;