ASoC: Taint the kernel if debugfs is used to write directly to CODECs
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 6 Jan 2011 16:04:57 +0000 (16:04 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 10 Jan 2011 11:41:07 +0000 (11:41 +0000)
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 <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
sound/soc/soc-core.c

index bac7291b6ff625a131d461bd8e5123814bfb961d..96bf381683f7e68566ff60578ddb97600f6778b5 100644 (file)
@@ -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;
 }