diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2010-01-13 14:44:31 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-01-13 14:44:44 -0500 |
commit | 8f3eabe3835449117058efaf5e90f28bf030e859 (patch) | |
tree | af064c7bc957b84eef9c51e06308803990b289f3 /drivers/s390/char/vmcp.c | |
parent | 44ee6a8564a89a77206b0b13cea91fc2f4ff997d (diff) |
[S390] vmcp: add missing compat ptr conversion
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char/vmcp.c')
-rw-r--r-- | drivers/s390/char/vmcp.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c index a6087cec55b4..921dcda77676 100644 --- a/drivers/s390/char/vmcp.c +++ b/drivers/s390/char/vmcp.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
20 | #include <linux/miscdevice.h> | 20 | #include <linux/miscdevice.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <asm/compat.h> | ||
22 | #include <asm/cpcmd.h> | 23 | #include <asm/cpcmd.h> |
23 | #include <asm/debug.h> | 24 | #include <asm/debug.h> |
24 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
@@ -139,21 +140,26 @@ vmcp_write(struct file *file, const char __user *buff, size_t count, | |||
139 | static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 140 | static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
140 | { | 141 | { |
141 | struct vmcp_session *session; | 142 | struct vmcp_session *session; |
143 | int __user *argp; | ||
142 | int temp; | 144 | int temp; |
143 | 145 | ||
144 | session = (struct vmcp_session *)file->private_data; | 146 | session = (struct vmcp_session *)file->private_data; |
147 | if (is_compat_task()) | ||
148 | argp = compat_ptr(arg); | ||
149 | else | ||
150 | argp = (int __user *)arg; | ||
145 | if (mutex_lock_interruptible(&session->mutex)) | 151 | if (mutex_lock_interruptible(&session->mutex)) |
146 | return -ERESTARTSYS; | 152 | return -ERESTARTSYS; |
147 | switch (cmd) { | 153 | switch (cmd) { |
148 | case VMCP_GETCODE: | 154 | case VMCP_GETCODE: |
149 | temp = session->resp_code; | 155 | temp = session->resp_code; |
150 | mutex_unlock(&session->mutex); | 156 | mutex_unlock(&session->mutex); |
151 | return put_user(temp, (int __user *)arg); | 157 | return put_user(temp, argp); |
152 | case VMCP_SETBUF: | 158 | case VMCP_SETBUF: |
153 | free_pages((unsigned long)session->response, | 159 | free_pages((unsigned long)session->response, |
154 | get_order(session->bufsize)); | 160 | get_order(session->bufsize)); |
155 | session->response=NULL; | 161 | session->response=NULL; |
156 | temp = get_user(session->bufsize, (int __user *)arg); | 162 | temp = get_user(session->bufsize, argp); |
157 | if (get_order(session->bufsize) > 8) { | 163 | if (get_order(session->bufsize) > 8) { |
158 | session->bufsize = PAGE_SIZE; | 164 | session->bufsize = PAGE_SIZE; |
159 | temp = -EINVAL; | 165 | temp = -EINVAL; |
@@ -163,7 +169,7 @@ static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
163 | case VMCP_GETSIZE: | 169 | case VMCP_GETSIZE: |
164 | temp = session->resp_size; | 170 | temp = session->resp_size; |
165 | mutex_unlock(&session->mutex); | 171 | mutex_unlock(&session->mutex); |
166 | return put_user(temp, (int __user *)arg); | 172 | return put_user(temp, argp); |
167 | default: | 173 | default: |
168 | mutex_unlock(&session->mutex); | 174 | mutex_unlock(&session->mutex); |
169 | return -ENOIOCTLCMD; | 175 | return -ENOIOCTLCMD; |