summaryrefslogtreecommitdiffstats
path: root/drivers/ntb
diff options
context:
space:
mode:
authorAllen Hubbe <Allen.Hubbe@emc.com>2015-08-31 09:31:00 -0400
committerJon Mason <jdmason@kudzu.us>2015-09-07 15:27:12 -0400
commit9a07826f99034202dad589285a47132685d9538b (patch)
treee5fd9f1e2ab501bf50b91ff98b34e2f5b10487f2 /drivers/ntb
parent2aa2a77a489deda473c99a4c15074d092718912c (diff)
downloadlinux-9a07826f99034202dad589285a47132685d9538b.tar.gz
linux-9a07826f99034202dad589285a47132685d9538b.tar.bz2
linux-9a07826f99034202dad589285a47132685d9538b.zip
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')
-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];
}