]> git.baikalelectronics.ru Git - kernel.git/commit
HID: sensor-hub: Move the memset to sensor_hub_get_feature()
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tue, 27 Dec 2016 16:57:59 +0000 (08:57 -0800)
committerJiri Kosina <jkosina@suse.cz>
Mon, 2 Jan 2017 13:01:30 +0000 (14:01 +0100)
commit7c7b0ef4ecf204396e0f520d28f984c719e86b19
treeb08f1ce713d5a014824ac8f9a3762468ad987ce5
parentf0ec57ff1ac0ce30fd2caaf44a0c801b5f077a78
HID: sensor-hub: Move the memset to sensor_hub_get_feature()

While applying patch 27d4133d87e1: "HID: hid-sensor-hub: clear memory to
avoid random data", there was some issues in applying correct version of
the patch. This resulted in the breakage of sensor functions as all
request like power-up will be reset by the memset() in the function
sensor_hub_set_feature().
The reset of caller buffer should be in the function
sensor_hub_get_feature(), not in the sensor_hub_set_feature().

Fixes: 27d4133d87e1 ("HID: hid-sensor-hub: clear memory to avoid random data")
Cc: Stable <stable@vger.kernel.org> # 4.9+
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-sensor-hub.c