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
VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git]
/
drivers
/
pcmcia
/
ds.c
diff --git
a/drivers/pcmcia/ds.c
b/drivers/pcmcia/ds.c
index
7e93bfc
..
71592c7
100644
(file)
--- a/
drivers/pcmcia/ds.c
+++ b/
drivers/pcmcia/ds.c
@@
-797,7
+797,7
@@
out:
/*====================================================================*/
/*====================================================================*/
-static ssize_t ds_read(struct file *file, char *buf,
+static ssize_t ds_read(struct file *file, char
__user
*buf,
size_t count, loff_t *ppos)
{
struct pcmcia_bus_socket *s;
size_t count, loff_t *ppos)
{
struct pcmcia_bus_socket *s;
@@
-819,14
+819,14
@@
static ssize_t ds_read(struct file *file, char *buf,
ret = wait_event_interruptible(s->queue, !queue_empty(user));
if (ret == 0)
ret = wait_event_interruptible(s->queue, !queue_empty(user));
if (ret == 0)
- ret = put_user(get_queued_event(user), (int *)buf) ? -EFAULT : 4;
+ ret = put_user(get_queued_event(user), (int
__user
*)buf) ? -EFAULT : 4;
return ret;
} /* ds_read */
/*====================================================================*/
return ret;
} /* ds_read */
/*====================================================================*/
-static ssize_t ds_write(struct file *file, const char *buf,
+static ssize_t ds_write(struct file *file, const char
__user
*buf,
size_t count, loff_t *ppos)
{
struct pcmcia_bus_socket *s;
size_t count, loff_t *ppos)
{
struct pcmcia_bus_socket *s;
@@
-849,7
+849,7
@@
static ssize_t ds_write(struct file *file, const char *buf,
if (s->req_pending) {
s->req_pending--;
if (s->req_pending) {
s->req_pending--;
- get_user(s->req_result, (int *)buf);
+ get_user(s->req_result, (int
__user
*)buf);
if ((s->req_result != 0) || (s->req_pending == 0))
wake_up_interruptible(&s->request);
} else
if ((s->req_result != 0) || (s->req_pending == 0))
wake_up_interruptible(&s->request);
} else
@@
-888,6
+888,7
@@
static int ds_ioctl(struct inode * inode, struct file * file,
u_int cmd, u_long arg)
{
struct pcmcia_bus_socket *s;
u_int cmd, u_long arg)
{
struct pcmcia_bus_socket *s;
+ void __user *uarg = (char __user *)arg;
u_int size;
int ret, err;
ds_ioctl_arg_t buf;
u_int size;
int ret, err;
ds_ioctl_arg_t buf;
@@
-911,14
+912,14
@@
static int ds_ioctl(struct inode * inode, struct file * file,
return -EPERM;
if (cmd & IOC_IN) {
return -EPERM;
if (cmd & IOC_IN) {
- err = verify_area(VERIFY_READ,
(char *)
arg, size);
+ err = verify_area(VERIFY_READ,
u
arg, size);
if (err) {
ds_dbg(3, "ds_ioctl(): verify_read = %d\n", err);
return err;
}
}
if (cmd & IOC_OUT) {
if (err) {
ds_dbg(3, "ds_ioctl(): verify_read = %d\n", err);
return err;
}
}
if (cmd & IOC_OUT) {
- err = verify_area(VERIFY_WRITE,
(char *)
arg, size);
+ err = verify_area(VERIFY_WRITE,
u
arg, size);
if (err) {
ds_dbg(3, "ds_ioctl(): verify_write = %d\n", err);
return err;
if (err) {
ds_dbg(3, "ds_ioctl(): verify_write = %d\n", err);
return err;
@@
-927,7
+928,7
@@
static int ds_ioctl(struct inode * inode, struct file * file,
err = ret = 0;
err = ret = 0;
- if (cmd & IOC_IN) __copy_from_user((char *)&buf,
(char *)
arg, size);
+ if (cmd & IOC_IN) __copy_from_user((char *)&buf,
u
arg, size);
switch (cmd) {
case DS_ADJUST_RESOURCE_INFO:
switch (cmd) {
case DS_ADJUST_RESOURCE_INFO:
@@
-940,6
+941,7
@@
static int ds_ioctl(struct inode * inode, struct file * file,
ret = pcmcia_get_configuration_info(s->handle, &buf.config);
break;
case DS_GET_FIRST_TUPLE:
ret = pcmcia_get_configuration_info(s->handle, &buf.config);
break;
case DS_GET_FIRST_TUPLE:
+ pcmcia_validate_mem(s->parent);
ret = pcmcia_get_first_tuple(s->handle, &buf.tuple);
break;
case DS_GET_NEXT_TUPLE:
ret = pcmcia_get_first_tuple(s->handle, &buf.tuple);
break;
case DS_GET_NEXT_TUPLE:
@@
-961,6
+963,7
@@
static int ds_ioctl(struct inode * inode, struct file * file,
ret = pcmcia_get_status(s->handle, &buf.status);
break;
case DS_VALIDATE_CIS:
ret = pcmcia_get_status(s->handle, &buf.status);
break;
case DS_VALIDATE_CIS:
+ pcmcia_validate_mem(s->parent);
ret = pcmcia_validate_cis(s->handle, &buf.cisinfo);
break;
case DS_SUSPEND_CARD:
ret = pcmcia_validate_cis(s->handle, &buf.cisinfo);
break;
case DS_SUSPEND_CARD:
@@
-970,10
+973,10
@@
static int ds_ioctl(struct inode * inode, struct file * file,
ret = pcmcia_resume_card(s->parent);
break;
case DS_EJECT_CARD:
ret = pcmcia_resume_card(s->parent);
break;
case DS_EJECT_CARD:
-
ret
= pcmcia_eject_card(s->parent);
+
err
= pcmcia_eject_card(s->parent);
break;
case DS_INSERT_CARD:
break;
case DS_INSERT_CARD:
-
ret
= pcmcia_insert_card(s->parent);
+
err
= pcmcia_insert_card(s->parent);
break;
case DS_ACCESS_CONFIGURATION_REGISTER:
if ((buf.conf_reg.Action == CS_WRITE) && !capable(CAP_SYS_ADMIN))
break;
case DS_ACCESS_CONFIGURATION_REGISTER:
if ((buf.conf_reg.Action == CS_WRITE) && !capable(CAP_SYS_ADMIN))
@@
-1042,7
+1045,7
@@
static int ds_ioctl(struct inode * inode, struct file * file,
}
}
}
}
- if (cmd & IOC_OUT) __copy_to_user(
(char *)
arg, (char *)&buf, size);
+ if (cmd & IOC_OUT) __copy_to_user(
u
arg, (char *)&buf, size);
return err;
} /* ds_ioctl */
return err;
} /* ds_ioctl */