diff options
Diffstat (limited to 'litmus/litmus.c')
-rw-r--r-- | litmus/litmus.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/litmus/litmus.c b/litmus/litmus.c index 2f780222d8e8..debfc45bb8e6 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c | |||
@@ -75,6 +75,7 @@ asmlinkage long sys_set_rt_task_param(pid_t pid, struct rt_task __user * param) | |||
75 | { | 75 | { |
76 | struct rt_task tp; | 76 | struct rt_task tp; |
77 | struct task_struct *target; | 77 | struct task_struct *target; |
78 | int * lookup_table; | ||
78 | int retval = -EINVAL; | 79 | int retval = -EINVAL; |
79 | 80 | ||
80 | printk("Setting up rt task parameters for process %d.\n", pid); | 81 | printk("Setting up rt task parameters for process %d.\n", pid); |
@@ -124,7 +125,19 @@ asmlinkage long sys_set_rt_task_param(pid_t pid, struct rt_task __user * param) | |||
124 | pid, tp.budget_policy); | 125 | pid, tp.budget_policy); |
125 | goto out_unlock; | 126 | goto out_unlock; |
126 | } | 127 | } |
127 | 128 | if (tp.lookup_len > 0) { | |
129 | lookup_table = kmalloc(tp.lookup_len * sizeof(unsigned int), | ||
130 | GFP_KERNEL); | ||
131 | if (!lookup_table) | ||
132 | goto out_unlock; | ||
133 | if (copy_from_user(lookup_table, tp.lookup_table, tp.lookup_len | ||
134 | * sizeof(lookup_table))) { | ||
135 | retval = -EFAULT; | ||
136 | kfree(lookup_table); | ||
137 | goto out_unlock; | ||
138 | } | ||
139 | tp.lookup_table = lookup_table; | ||
140 | } | ||
128 | target->rt_param.task_params = tp; | 141 | target->rt_param.task_params = tp; |
129 | 142 | ||
130 | retval = 0; | 143 | retval = 0; |