Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a07826f authored by Allen Hubbe's avatar Allen Hubbe Committed by Jon Mason
Browse files

NTB: Fix range check on memory window index



The range check must exclude the upper bound.

Signed-off-by: default avatarAllen Hubbe <Allen.Hubbe@emc.com>
Signed-off-by: default avatarJon Mason <jdmason@kudzu.us>
parent 2aa2a77a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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];
}