X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Foss%2Fopl3.c;h=2e8cfa5481f28c4e1e7d7f2d40b5326538bd02d7;hb=fc03ebed5ae638d12ddc5aa5479c8d05ef67a3f7;hp=c69c135a949c00116d7905a1477e9682895b695f;hpb=bc77d24c47b89f1e0efed0b8e4be5f8aad102883;p=linux-2.6.git diff --git a/sound/oss/opl3.c b/sound/oss/opl3.c index c69c135a9..2e8cfa548 100644 --- a/sound/oss/opl3.c +++ b/sound/oss/opl3.c @@ -1,5 +1,5 @@ /* - * sound/opl3.c + * sound/oss/opl3.c * * A low level driver for Yamaha YM3812 and OPL-3 -chips * @@ -166,7 +166,7 @@ int opl3_detect(int ioaddr, int *osp) return 0; } - devc = (struct opl_devinfo *)kmalloc(sizeof(*devc), GFP_KERNEL); + devc = kmalloc(sizeof(*devc), GFP_KERNEL); if (devc == NULL) { @@ -822,7 +822,7 @@ static void opl3_hw_control(int dev, unsigned char *event) { } -static int opl3_load_patch(int dev, int format, const char *addr, +static int opl3_load_patch(int dev, int format, const char __user *addr, int offs, int count, int pmgr_flag) { struct sbi_instrument ins; @@ -833,7 +833,11 @@ static int opl3_load_patch(int dev, int format, const char *addr, return -EINVAL; } - if(copy_from_user(&((char *) &ins)[offs], &(addr)[offs], sizeof(ins) - offs)) + /* + * What the fuck is going on here? We leave junk in the beginning + * of ins and then check the field pretty close to that beginning? + */ + if(copy_from_user(&((char *) &ins)[offs], addr + offs, sizeof(ins) - offs)) return -EFAULT; if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR) @@ -1198,7 +1202,7 @@ static int me; static int io = -1; -MODULE_PARM(io, "i"); +module_param(io, int, 0); static int __init init_opl3 (void) {