Skip to content

Commit

Permalink
sound: oss: midi_synth: check get_user() return value
Browse files Browse the repository at this point in the history
get_user() may fail, if so return -EFAULT.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Kulikov Vasiliy authored and Takashi Iwai committed Jul 29, 2010
1 parent 5157cc8 commit b3390ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/oss/midi_synth.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@ midi_synth_load_patch(int dev, int format, const char __user *addr,
{
unsigned char data;

get_user(*(unsigned char *) &data, (unsigned char __user *) &((addr)[hdr_size + i]));
if (get_user(data,
(unsigned char __user *)(addr + hdr_size + i)))
return -EFAULT;

eox_seen = (i > 0 && data & 0x80); /* End of sysex */

Expand Down

0 comments on commit b3390ce

Please sign in to comment.