X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Foss%2Fopl3.c;h=2e8cfa5481f28c4e1e7d7f2d40b5326538bd02d7;hb=refs%2Fheads%2Fvserver;hp=cc9ce47312c09c2e96fac62a055b37aaf3d106e0;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/sound/oss/opl3.c b/sound/oss/opl3.c index cc9ce4731..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 * @@ -110,7 +110,7 @@ static void enter_4op_mode(void) devc->v_alloc->max_voice = devc->nr_voice = 12; } -static int opl3_ioctl(int dev, unsigned int cmd, caddr_t arg) +static int opl3_ioctl(int dev, unsigned int cmd, void __user * arg) { struct sbi_instrument ins; @@ -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) {