summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_hwdep.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-12-27 13:53:24 +0100
committerTakashi Iwai <tiwai@suse.de>2009-12-27 13:53:24 +0100
commit014c41fce1bd5cec381e70fc6f58fdfc96cdaf69 (patch)
tree148d95c1f27acaee25991e6b1cb9e606d91f899d /sound/pci/hda/hda_hwdep.c
parentALSA: hda - Add sanity check for storing the user-defined pin configs (diff)
downloadlinux-014c41fce1bd5cec381e70fc6f58fdfc96cdaf69.tar.xz
linux-014c41fce1bd5cec381e70fc6f58fdfc96cdaf69.zip
ALSA: hda - Use strict_strtoul()
Rewrite the codes to use strict_strtoul() instead of simple_strtoul(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_hwdep.c')
-rw-r--r--sound/pci/hda/hda_hwdep.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c
index 40ccb419b6e9..b36919c0d363 100644
--- a/sound/pci/hda/hda_hwdep.c
+++ b/sound/pci/hda/hda_hwdep.c
@@ -293,8 +293,11 @@ static ssize_t type##_store(struct device *dev, \
{ \
struct snd_hwdep *hwdep = dev_get_drvdata(dev); \
struct hda_codec *codec = hwdep->private_data; \
- char *after; \
- codec->type = simple_strtoul(buf, &after, 0); \
+ unsigned long val; \
+ int err = strict_strtoul(buf, 0, &val); \
+ if (err < 0) \
+ return err; \
+ codec->type = val; \
return count; \
}