diff options
author | Kulikov Vasiliy <segooon@gmail.com> | 2010-07-28 20:41:17 +0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2012-03-14 10:57:05 -0400 |
commit | 387b3e0a0ce26408e764e7bf268e8d98c4a660b7 (patch) | |
tree | d1d0ad1683f19f9be1249e66d526d3d2f8ae8c4b /sound | |
parent | 10be7dff113acfc430264c13e8bfe8c9397f1697 (diff) |
sound: oss: midi_synth: check get_user() return value
commit b3390ceab95601afc12213c3ec5551d3bc7b638f upstream.
get_user() may fail, if so return -EFAULT.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/oss/midi_synth.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/oss/midi_synth.c b/sound/oss/midi_synth.c index 11685f12569d..2292c230d7e6 100644 --- a/sound/oss/midi_synth.c +++ b/sound/oss/midi_synth.c @@ -519,7 +519,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 */ |