Skip to content

Commit f29145e

Browse files
author
Linus Torvalds
committed
Merge bk://bk.arm.linux.org.uk/linux-2.6-pcmcia
into ppc970.osdl.org:/home/torvalds/v2.6/linux
2 parents eb01308 + 9079524 commit f29145e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

drivers/pcmcia/ds.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ static int ds_release(struct inode *inode, struct file *file)
797797

798798
/*====================================================================*/
799799

800-
static ssize_t ds_read(struct file *file, char *buf,
800+
static ssize_t ds_read(struct file *file, char __user *buf,
801801
size_t count, loff_t *ppos)
802802
{
803803
struct pcmcia_bus_socket *s;
@@ -819,14 +819,14 @@ static ssize_t ds_read(struct file *file, char *buf,
819819

820820
ret = wait_event_interruptible(s->queue, !queue_empty(user));
821821
if (ret == 0)
822-
ret = put_user(get_queued_event(user), (int *)buf) ? -EFAULT : 4;
822+
ret = put_user(get_queued_event(user), (int __user *)buf) ? -EFAULT : 4;
823823

824824
return ret;
825825
} /* ds_read */
826826

827827
/*====================================================================*/
828828

829-
static ssize_t ds_write(struct file *file, const char *buf,
829+
static ssize_t ds_write(struct file *file, const char __user *buf,
830830
size_t count, loff_t *ppos)
831831
{
832832
struct pcmcia_bus_socket *s;
@@ -849,7 +849,7 @@ static ssize_t ds_write(struct file *file, const char *buf,
849849

850850
if (s->req_pending) {
851851
s->req_pending--;
852-
get_user(s->req_result, (int *)buf);
852+
get_user(s->req_result, (int __user *)buf);
853853
if ((s->req_result != 0) || (s->req_pending == 0))
854854
wake_up_interruptible(&s->request);
855855
} else
@@ -888,6 +888,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
888888
u_int cmd, u_long arg)
889889
{
890890
struct pcmcia_bus_socket *s;
891+
void __user *uarg = (char __user *)arg;
891892
u_int size;
892893
int ret, err;
893894
ds_ioctl_arg_t buf;
@@ -911,14 +912,14 @@ static int ds_ioctl(struct inode * inode, struct file * file,
911912
return -EPERM;
912913

913914
if (cmd & IOC_IN) {
914-
err = verify_area(VERIFY_READ, (char *)arg, size);
915+
err = verify_area(VERIFY_READ, uarg, size);
915916
if (err) {
916917
ds_dbg(3, "ds_ioctl(): verify_read = %d\n", err);
917918
return err;
918919
}
919920
}
920921
if (cmd & IOC_OUT) {
921-
err = verify_area(VERIFY_WRITE, (char *)arg, size);
922+
err = verify_area(VERIFY_WRITE, uarg, size);
922923
if (err) {
923924
ds_dbg(3, "ds_ioctl(): verify_write = %d\n", err);
924925
return err;
@@ -927,7 +928,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
927928

928929
err = ret = 0;
929930

930-
if (cmd & IOC_IN) __copy_from_user((char *)&buf, (char *)arg, size);
931+
if (cmd & IOC_IN) __copy_from_user((char *)&buf, uarg, size);
931932

932933
switch (cmd) {
933934
case DS_ADJUST_RESOURCE_INFO:
@@ -1042,7 +1043,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
10421043
}
10431044
}
10441045

1045-
if (cmd & IOC_OUT) __copy_to_user((char *)arg, (char *)&buf, size);
1046+
if (cmd & IOC_OUT) __copy_to_user(uarg, (char *)&buf, size);
10461047

10471048
return err;
10481049
} /* ds_ioctl */

0 commit comments

Comments
 (0)