summaryrefslogtreecommitdiff
path: root/drivers/ntb/hw
diff options
context:
space:
mode:
authorAllen Hubbe <Allen.Hubbe@emc.com>2015-08-31 16:31:00 +0300
committerJon Mason <jdmason@kudzu.us>2015-09-07 22:27:12 +0300
commit9a07826f99034202dad589285a47132685d9538b (patch)
treee5fd9f1e2ab501bf50b91ff98b34e2f5b10487f2 /drivers/ntb/hw
parent2aa2a77a489deda473c99a4c15074d092718912c (diff)
downloadlinux-9a07826f99034202dad589285a47132685d9538b.tar.xz
NTB: Fix range check on memory window index
The range check must exclude the upper bound. Signed-off-by: Allen Hubbe <Allen.Hubbe@emc.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'drivers/ntb/hw')
-rw-r--r--drivers/ntb/hw/intel/ntb_hw_intel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ntb/hw/intel/ntb_hw_intel.c b/drivers/ntb/hw/intel/ntb_hw_intel.c
index fc6af2da8df0..865a3e3cc581 100644
--- a/drivers/ntb/hw/intel/ntb_hw_intel.c
+++ b/drivers/ntb/hw/intel/ntb_hw_intel.c
@@ -240,7 +240,7 @@ static inline int ndev_ignore_unsafe(struct intel_ntb_dev *ndev,
static int ndev_mw_to_bar(struct intel_ntb_dev *ndev, int idx)
{
- if (idx < 0 || idx > ndev->mw_count)
+ if (idx < 0 || idx >= ndev->mw_count)
return -EINVAL;
return ndev->reg->mw_bar[idx];
}