Commit 0d51a9cb authored by Mark Brown's avatar Mark Brown

ASoC: Taint the kernel if debugfs is used to write directly to CODECs

Since direct register writes may confuse the drivers and are supposed
to be used only in diagnostic situations discourage their use in
production by tainting the kernel when we do a write.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 9c6df19e
...@@ -209,6 +209,10 @@ static ssize_t codec_reg_write_file(struct file *file, ...@@ -209,6 +209,10 @@ static ssize_t codec_reg_write_file(struct file *file,
start++; start++;
if (strict_strtoul(start, 16, &value)) if (strict_strtoul(start, 16, &value))
return -EINVAL; return -EINVAL;
/* Userspace has been fiddling around behind the kernel's back */
add_taint(TAINT_USER);
snd_soc_write(codec, reg, value); snd_soc_write(codec, reg, value);
return buf_size; return buf_size;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment