diff options
| author | Roel Kluin <roel.kluin@gmail.com> | 2009-10-10 16:21:59 -0400 |
|---|---|---|
| committer | Tony Luck <tony.luck@intel.com> | 2009-10-13 13:40:00 -0400 |
| commit | dec1798f81f7e8a299734bdc29197ae77bf08018 (patch) | |
| tree | 308a3a3b50b79871c8d7c73ed25845ad6abcc640 | |
| parent | 29e4e025be52c0619b9dfe6faba29bc3deac6272 (diff) | |
[IA64] unsigned cannot be less than 0 in sn_hwperf_ioctl()
struct sn_hwperf_ioctl_args member arg (u64) cannot be less than 0.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
| -rw-r--r-- | arch/ia64/sn/kernel/sn2/sn_hwperf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c index 4c7e74790958..55ac3c4e11d2 100644 --- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c +++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c | |||
| @@ -786,17 +786,18 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, unsigned long arg) | |||
| 786 | break; | 786 | break; |
| 787 | 787 | ||
| 788 | case SN_HWPERF_GET_OBJ_NODE: | 788 | case SN_HWPERF_GET_OBJ_NODE: |
| 789 | if (a.sz != sizeof(u64) || a.arg < 0) { | 789 | i = a.arg; |
| 790 | if (a.sz != sizeof(u64) || i < 0) { | ||
| 790 | r = -EINVAL; | 791 | r = -EINVAL; |
| 791 | goto error; | 792 | goto error; |
| 792 | } | 793 | } |
| 793 | if ((r = sn_hwperf_enum_objects(&nobj, &objs)) == 0) { | 794 | if ((r = sn_hwperf_enum_objects(&nobj, &objs)) == 0) { |
| 794 | if (a.arg >= nobj) { | 795 | if (i >= nobj) { |
| 795 | r = -EINVAL; | 796 | r = -EINVAL; |
| 796 | vfree(objs); | 797 | vfree(objs); |
| 797 | goto error; | 798 | goto error; |
| 798 | } | 799 | } |
| 799 | if (objs[(i = a.arg)].id != a.arg) { | 800 | if (objs[i].id != a.arg) { |
| 800 | for (i = 0; i < nobj; i++) { | 801 | for (i = 0; i < nobj; i++) { |
| 801 | if (objs[i].id == a.arg) | 802 | if (objs[i].id == a.arg) |
| 802 | break; | 803 | break; |
