Commit 32568578 authored by Arun Sharma's avatar Arun Sharma Committed by David Mosberger

[PATCH] ia64: IA-32 support patch: msgsnd/msgrcv return value off by 4

parent 56263875
...@@ -1275,7 +1275,7 @@ semctl32 (int first, int second, int third, void *uptr) ...@@ -1275,7 +1275,7 @@ semctl32 (int first, int second, int third, void *uptr)
static int static int
do_sys32_msgsnd (int first, int second, int third, void *uptr) do_sys32_msgsnd (int first, int second, int third, void *uptr)
{ {
struct msgbuf *p = kmalloc(second + sizeof(struct msgbuf) + 4, GFP_USER); struct msgbuf *p = kmalloc(second + sizeof(struct msgbuf), GFP_USER);
struct msgbuf32 *up = (struct msgbuf32 *)uptr; struct msgbuf32 *up = (struct msgbuf32 *)uptr;
mm_segment_t old_fs; mm_segment_t old_fs;
int err; int err;
...@@ -1317,12 +1317,12 @@ do_sys32_msgrcv (int first, int second, int msgtyp, int third, int version, void ...@@ -1317,12 +1317,12 @@ do_sys32_msgrcv (int first, int second, int msgtyp, int third, int version, void
msgtyp = ipck.msgtyp; msgtyp = ipck.msgtyp;
} }
err = -ENOMEM; err = -ENOMEM;
p = kmalloc(second + sizeof(struct msgbuf) + 4, GFP_USER); p = kmalloc(second + sizeof(struct msgbuf), GFP_USER);
if (!p) if (!p)
goto out; goto out;
old_fs = get_fs(); old_fs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
err = sys_msgrcv(first, p, second + 4, msgtyp, third); err = sys_msgrcv(first, p, second, msgtyp, third);
set_fs(old_fs); set_fs(old_fs);
if (err < 0) if (err < 0)
goto free_then_out; goto free_then_out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment