mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-13 13:32:25 +01:00
iio: tmp006: Check channel info on write
only SAMP_FREQ is writable Will lead to SAMP_FREQ being written by any attempt to write to the other exported attributes and hence a rather unexpected result! Signed-off-by: Peter Meerwald <[email protected]> Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
This commit is contained in:
1 parent
897993fecb
commit
8d05abfaef
1 file changed
+3
@@ -132,6 +132,9 @@ static int tmp006_write_raw(struct iio_dev *indio_dev,
|
||||
struct tmp006_data *data = iio_priv(indio_dev);
|
||||
int i;
|
||||
|
||||
if (mask != IIO_CHAN_INFO_SAMP_FREQ)
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(tmp006_freqs); i++)
|
||||
if ((val == tmp006_freqs[i][0]) &&
|
||||
(val2 == tmp006_freqs[i][1])) {
|
||||
|
||||
Reference in new issue
Block a user