diff options
author | Hefty, Sean <sean.hefty@intel.com> | 2011-10-06 16:33:05 (GMT) |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2011-10-06 16:33:05 (GMT) |
commit | caf6e3f221ddc12ccabd1cd0ba149561db0090d4 (patch) | |
tree | 99790c5bdeb1ed62eb0262d78f6f5a7563def9bc /drivers/infiniband/core/user_mad.c | |
parent | b7ab0b19a85fffaa04ad0b59471d3a607eef0a56 (diff) | |
download | linux-fsl-qoriq-caf6e3f221ddc12ccabd1cd0ba149561db0090d4.tar.xz |
RDMA/ucm: Removed checks for unsigned value < 0
cmd is unsigned, no need to check for < 0. Found by code inspection.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/core/user_mad.c')
-rw-r--r-- | drivers/infiniband/core/user_mad.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c index 8d261b6..07db229 100644 --- a/drivers/infiniband/core/user_mad.c +++ b/drivers/infiniband/core/user_mad.c @@ -458,8 +458,7 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf, goto err; } - if (packet->mad.hdr.id < 0 || - packet->mad.hdr.id >= IB_UMAD_MAX_AGENTS) { + if (packet->mad.hdr.id >= IB_UMAD_MAX_AGENTS) { ret = -EINVAL; goto err; } @@ -703,7 +702,7 @@ static int ib_umad_unreg_agent(struct ib_umad_file *file, u32 __user *arg) mutex_lock(&file->port->file_mutex); mutex_lock(&file->mutex); - if (id < 0 || id >= IB_UMAD_MAX_AGENTS || !__get_agent(file, id)) { + if (id >= IB_UMAD_MAX_AGENTS || !__get_agent(file, id)) { ret = -EINVAL; goto out; } |