]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
iio: hid-sensor-attributes: Check sample_frequency/hysteresis write data legitimacy
authorSong Hongyan <hongyan.song@intel.com>
Thu, 3 Nov 2016 00:45:48 +0000 (00:45 +0000)
committerJonathan Cameron <jic23@kernel.org>
Sat, 5 Nov 2016 16:25:33 +0000 (16:25 +0000)
commitab54163190f236e30772e6e8b4efc56a319ed0a6
treee367d162de3d6f512ceeca4626dbaa50d370c93a
parent43a07e48af44c153f960e4a204771d5911e10134
iio: hid-sensor-attributes: Check sample_frequency/hysteresis write data legitimacy

Neither sample frequency value nor hysteresis value can be set to be a
negative number, check and return "Invalid argument" if they are negative.

If not do this change, sample_frequency will be set into some unknown
value, read hysteresis value after write negative number will return
"Invalid argument".

Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/common/hid-sensors/hid-sensor-attributes.c