aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/kspd.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-03-16 08:16:27 -0400
committerRalf Baechle <ralf@linux-mips.org>2007-03-16 21:03:29 -0400
commit46230aa6ea1671690e3e5efa2a961fc0745fe9b5 (patch)
tree9224af1ccdb48fac6d0b400b6a76e2d62f104972 /arch/mips/kernel/kspd.c
parentbc4809e939b91c9642f1ddaea732e2d432ee6af6 (diff)
[MIPS] RTLX: Handle copy_*_user return values.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/kspd.c')
-rw-r--r--arch/mips/kernel/kspd.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c
index 241ee7a2906e..29eadd404fa5 100644
--- a/arch/mips/kernel/kspd.c
+++ b/arch/mips/kernel/kspd.c
@@ -191,6 +191,8 @@ void sp_work_handle_request(void)
191 struct mtsp_syscall_generic generic; 191 struct mtsp_syscall_generic generic;
192 struct mtsp_syscall_ret ret; 192 struct mtsp_syscall_ret ret;
193 struct kspd_notifications *n; 193 struct kspd_notifications *n;
194 unsigned long written;
195 mm_segment_t old_fs;
194 struct timeval tv; 196 struct timeval tv;
195 struct timezone tz; 197 struct timezone tz;
196 int cmd; 198 int cmd;
@@ -201,7 +203,11 @@ void sp_work_handle_request(void)
201 203
202 ret.retval = -1; 204 ret.retval = -1;
203 205
204 if (!rtlx_read(RTLX_CHANNEL_SYSIO, &sc, sizeof(struct mtsp_syscall), 0)) { 206 old_fs = get_fs();
207 set_fs(KERNEL_DS);
208
209 if (!rtlx_read(RTLX_CHANNEL_SYSIO, &sc, sizeof(struct mtsp_syscall))) {
210 set_fs(old_fs);
205 printk(KERN_ERR "Expected request but nothing to read\n"); 211 printk(KERN_ERR "Expected request but nothing to read\n");
206 return; 212 return;
207 } 213 }
@@ -209,7 +215,8 @@ void sp_work_handle_request(void)
209 size = sc.size; 215 size = sc.size;
210 216
211 if (size) { 217 if (size) {
212 if (!rtlx_read(RTLX_CHANNEL_SYSIO, &generic, size, 0)) { 218 if (!rtlx_read(RTLX_CHANNEL_SYSIO, &generic, size)) {
219 set_fs(old_fs);
213 printk(KERN_ERR "Expected request but nothing to read\n"); 220 printk(KERN_ERR "Expected request but nothing to read\n");
214 return; 221 return;
215 } 222 }
@@ -282,8 +289,11 @@ void sp_work_handle_request(void)
282 if (vpe_getuid(SP_VPE)) 289 if (vpe_getuid(SP_VPE))
283 sp_setfsuidgid( 0, 0); 290 sp_setfsuidgid( 0, 0);
284 291
285 if ((rtlx_write(RTLX_CHANNEL_SYSIO, &ret, sizeof(struct mtsp_syscall_ret), 0)) 292 old_fs = get_fs();
286 < sizeof(struct mtsp_syscall_ret)) 293 set_fs(KERNEL_DS);
294 written = rtlx_write(RTLX_CHANNEL_SYSIO, &ret, sizeof(ret));
295 set_fs(old_fs);
296 if (written < sizeof(ret))
287 printk("KSPD: sp_work_handle_request failed to send to SP\n"); 297 printk("KSPD: sp_work_handle_request failed to send to SP\n");
288} 298}
289 299