mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
sound: oss: midi_synth: check get_user() return value
get_user() may fail, if so return -EFAULT. Signed-off-by: Kulikov Vasiliy <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
This commit is contained in:
parent
5157cc8113
commit
b3390ceab9
1 changed files with 3 additions and 1 deletions
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue