summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Marciniszyn <mike.marciniszyn@intel.com>2015-09-15 16:19:27 +0200
committerDoug Ledford <dledford@redhat.com>2015-09-18 17:28:47 +0200
commitaeef010a0f63ad0a6f993d3da30753e9a8a39ec5 (patch)
tree29e8344814e2bc1cf80d0823c328472f25020616
parentIB/hfi1: fix copy_to/from_user() error handling (diff)
downloadlinux-aeef010a0f63ad0a6f993d3da30753e9a8a39ec5.tar.xz
linux-aeef010a0f63ad0a6f993d3da30753e9a8a39ec5.zip
IB/hfi1: fix sdma_descq_cnt parameter parsing
The boolean tests should have been or-ed. Reported-by: David Binderman <dcb314@hotmail.com> Reviewed-by: Jubin John <jubin.john@intel.com> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/staging/rdma/hfi1/sdma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rdma/hfi1/sdma.c b/drivers/staging/rdma/hfi1/sdma.c
index a8c903caecce..7e01f30f67b9 100644
--- a/drivers/staging/rdma/hfi1/sdma.c
+++ b/drivers/staging/rdma/hfi1/sdma.c
@@ -737,7 +737,7 @@ u16 sdma_get_descq_cnt(void)
*/
if (!is_power_of_2(count))
return SDMA_DESCQ_CNT;
- if (count < 64 && count > 32768)
+ if (count < 64 || count > 32768)
return SDMA_DESCQ_CNT;
return count;
}