Skip to content

Commit

Permalink
ALSA: line6: fix a crash in line6_hwdep_write()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Takashi Sakamoto <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Dan Carpenter authored and tiwai committed Oct 12, 2016
1 parent 30c0702 commit fdd8218
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/usb/line6/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit fdd8218

Please sign in to comment.