diff options
Diffstat (limited to 'drivers/misc/sgi-gru/grufile.c')
-rw-r--r-- | drivers/misc/sgi-gru/grufile.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c index 9e6da46eeb04..b1567ce868e9 100644 --- a/drivers/misc/sgi-gru/grufile.c +++ b/drivers/misc/sgi-gru/grufile.c | |||
@@ -135,11 +135,9 @@ static int gru_create_new_context(unsigned long arg) | |||
135 | if (copy_from_user(&req, (void __user *)arg, sizeof(req))) | 135 | if (copy_from_user(&req, (void __user *)arg, sizeof(req))) |
136 | return -EFAULT; | 136 | return -EFAULT; |
137 | 137 | ||
138 | if (req.data_segment_bytes == 0 || | 138 | if (req.data_segment_bytes > max_user_dsr_bytes) |
139 | req.data_segment_bytes > max_user_dsr_bytes) | ||
140 | return -EINVAL; | 139 | return -EINVAL; |
141 | if (!req.control_blocks || !req.maximum_thread_count || | 140 | if (req.control_blocks > max_user_cbrs || !req.maximum_thread_count) |
142 | req.control_blocks > max_user_cbrs) | ||
143 | return -EINVAL; | 141 | return -EINVAL; |
144 | 142 | ||
145 | if (!(req.options & GRU_OPT_MISS_MASK)) | 143 | if (!(req.options & GRU_OPT_MISS_MASK)) |