summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-10-12 09:21:40 +0300
committerTakashi Iwai <tiwai@suse.de>2016-10-12 21:10:23 +0300
commitfdd8218d7d1bd0ccb9a3f4c58bf77773691a56cc (patch)
tree357cdef6b64cc3afc2cdb4d102b56a9b0eacb2f9 /sound
parent30c0702246ac1ba955aa97d698610169242f59f1 (diff)
downloadlinux-fdd8218d7d1bd0ccb9a3f4c58bf77773691a56cc.tar.xz
ALSA: line6: fix a crash in line6_hwdep_write()
The error checking here is messed up so we could end up dereferencing -EFAULT. Fixes: a16039cbf1a1 ('ALSA: line6: Add hwdep interface to access the POD control messages') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/line6/driver.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
index 14e587e70655..90009c0b3a92 100644
--- a/sound/usb/line6/driver.c
+++ b/sound/usb/line6/driver.c
@@ -604,8 +604,8 @@ line6_hwdep_write(struct snd_hwdep *hwdep, const char __user *data, long count,
}
data_copy = memdup_user(data, count);
- if (IS_ERR(ERR_PTR))
- return -ENOMEM;
+ if (IS_ERR(data_copy))
+ return PTR_ERR(data_copy);
rv = line6_send_raw_message(line6, data_copy, count);