From: Mark Brown Date: Thu, 6 Jan 2011 16:04:57 +0000 (+0000) Subject: ASoC: Taint the kernel if debugfs is used to write directly to CODECs X-Git-Tag: v2.6.39-rc7~5^2~24^2~220 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d51a9cbb6c1275cc0f3840c36f8b7840a438c59;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git 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: Mark Brown Acked-by: Liam Girdwood --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index bac7291..96bf381 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -209,6 +209,10 @@ static ssize_t codec_reg_write_file(struct file *file, start++; if (strict_strtoul(start, 16, &value)) return -EINVAL; + + /* Userspace has been fiddling around behind the kernel's back */ + add_taint(TAINT_USER); + snd_soc_write(codec, reg, value); return buf_size; }