1
0
Fork 0

ALSA: line6: fix a crash in line6_hwdep_write()

The error checking here is messed up so we could end up dereferencing
-EFAULT.

Fixes: a16039cbf1 ('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>
hifive-unleashed-5.1
Dan Carpenter 2016-10-12 09:21:40 +03:00 committed by Takashi Iwai
parent 30c0702246
commit fdd8218d7d
1 changed files with 2 additions and 2 deletions

View File

@ -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);