git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
sound
/
oss
/
opl3.c
diff --git
a/sound/oss/opl3.c
b/sound/oss/opl3.c
index
cc9ce47
..
2e8cfa5
100644
(file)
--- a/
sound/oss/opl3.c
+++ b/
sound/oss/opl3.c
@@
-1,5
+1,5
@@
/*
/*
- * sound/opl3.c
+ * sound/o
ss/o
pl3.c
*
* A low level driver for Yamaha YM3812 and OPL-3 -chips
*
*
* 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;
}
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;
{
struct sbi_instrument ins;
@@
-166,7
+166,7
@@
int opl3_detect(int ioaddr, int *osp)
return 0;
}
return 0;
}
- devc =
(struct opl_devinfo *)
kmalloc(sizeof(*devc), GFP_KERNEL);
+ devc = kmalloc(sizeof(*devc), GFP_KERNEL);
if (devc == NULL)
{
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;
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;
}
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)
return -EFAULT;
if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR)
@@
-1198,7
+1202,7
@@
static int me;
static int io = -1;
static int io = -1;
-
MODULE_PARM(io, "i"
);
+
module_param(io, int, 0
);
static int __init init_opl3 (void)
{
static int __init init_opl3 (void)
{