]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sound: oss: midi_synth: check get_user() return value
authorKulikov Vasiliy <segooon@gmail.com>
Wed, 28 Jul 2010 16:41:17 +0000 (20:41 +0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 14 Apr 2011 23:53:09 +0000 (16:53 -0700)
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: Greg Kroah-Hartman <gregkh@suse.de>
sound/oss/midi_synth.c

index 11685f12569d16f1ecae27c8ce7c04c94a955670..2292c230d7e6fb33d0894e9b8fff16d4e2d4e552 100644 (file)
@@ -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 */