aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorDimitri Sivanich <sivanich@sgi.com>2013-07-03 18:05:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:07:42 -0400
commita7d0dabb3e863a1d4018235c1384b4318322116a (patch)
treed3393110354289598eb661f5b573339c3a06f171 /drivers/misc
parent48a9db462d99494583dad829969616ac90a8df4e (diff)
drivers/misc/sgi-gru/grufault.c: fix a sanity test in gru_set_context_option()
"req.val1 == -1" is valid but it doesn't make sense to check gru_base[-1]. gru_base[] is a global array. Signed-off-by: Dimitri Sivanich <sivanich@sgi.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: Robin Holt <holt@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/sgi-gru/grufault.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c
index c4acac74725c..f74fc0ca2ef9 100644
--- a/drivers/misc/sgi-gru/grufault.c
+++ b/drivers/misc/sgi-gru/grufault.c
@@ -876,8 +876,9 @@ int gru_set_context_option(unsigned long arg)
876 switch (req.op) { 876 switch (req.op) {
877 case sco_blade_chiplet: 877 case sco_blade_chiplet:
878 /* Select blade/chiplet for GRU context */ 878 /* Select blade/chiplet for GRU context */
879 if (req.val1 < -1 || req.val1 >= GRU_MAX_BLADES || !gru_base[req.val1] || 879 if (req.val0 < -1 || req.val0 >= GRU_CHIPLETS_PER_HUB ||
880 req.val0 < -1 || req.val0 >= GRU_CHIPLETS_PER_HUB) { 880 req.val1 < -1 || req.val1 >= GRU_MAX_BLADES ||
881 (req.val1 >= 0 && !gru_base[req.val1])) {
881 ret = -EINVAL; 882 ret = -EINVAL;
882 } else { 883 } else {
883 gts->ts_user_blade_id = req.val1; 884 gts->ts_user_blade_id = req.val1;