Skip to content

Commit fdd8218

Browse files
Dan Carpentertiwai
authored andcommitted
ALSA: line6: fix a crash in line6_hwdep_write()
The error checking here is messed up so we could end up dereferencing -EFAULT. Fixes: a16039c ('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>
1 parent 30c0702 commit fdd8218

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sound/usb/line6/driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,8 @@ line6_hwdep_write(struct snd_hwdep *hwdep, const char __user *data, long count,
604604
}
605605

606606
data_copy = memdup_user(data, count);
607-
if (IS_ERR(ERR_PTR))
608-
return -ENOMEM;
607+
if (IS_ERR(data_copy))
608+
return PTR_ERR(data_copy);
609609

610610
rv = line6_send_raw_message(line6, data_copy, count);
611611

0 commit comments

Comments
 (0)