Skip to content

Commit 9a07826

Browse files
Allen Hubbejonmason
authored andcommitted
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>
1 parent 2aa2a77 commit 9a07826

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ntb/hw/intel/ntb_hw_intel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ static inline int ndev_ignore_unsafe(struct intel_ntb_dev *ndev,
240240

241241
static int ndev_mw_to_bar(struct intel_ntb_dev *ndev, int idx)
242242
{
243-
if (idx < 0 || idx > ndev->mw_count)
243+
if (idx < 0 || idx >= ndev->mw_count)
244244
return -EINVAL;
245245
return ndev->reg->mw_bar[idx];
246246
}

0 commit comments

Comments
 (0)