summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_hwdep.c
diff options
context:
space:
mode:
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 125e97fe0b1c..a86adb0acf80 100644
--- a/sound/pci/hda/hda_hwdep.c
+++ b/sound/pci/hda/hda_hwdep.c
@@ -22,14 +22,17 @@ static int verb_write_ioctl(struct hda_codec *codec,
struct hda_verb_ioctl __user *arg)
{
u32 verb, res;
+ int err;
if (get_user(verb, &arg->verb))
return -EFAULT;
+ err = snd_power_wait_and_ref(codec->card, true);
res = snd_hda_codec_read(codec, verb >> 24, 0,
(verb >> 8) & 0xffff, verb & 0xff);
if (put_user(res, &arg->res))
- return -EFAULT;
- return 0;
+ err = -EFAULT;
+ snd_power_unref(codec->card);
+ return err;
}
static int get_wcap_ioctl(struct hda_codec *codec,