ACPI/IORT: Fix off-by-one check in iort_dev_find_its_id()
commitab1ab88e93bea156af5e3fb0a3ce20f8ee3e0600
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 22 Jul 2019 16:25:48 +0000 (22 17:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Aug 2019 08:51:31 +0000 (25 10:51 +0200)
tree932d9a1232b42828d0d008c9e62b3242672c4d59
parentdfaf368e67c3371f71220dbb7400aed6f5d59c1a
ACPI/IORT: Fix off-by-one check in iort_dev_find_its_id()

[ Upstream commit 5a46d3f71d5e5a9f82eabc682f996f1281705ac7 ]

Static analysis identified that index comparison against ITS entries in
iort_dev_find_its_id() is off by one.

Update the comparison condition and clarify the resulting error
message.

Fixes: 4bf2efd26d76 ("ACPI: Add new IORT functions to support MSI domain handling")
Link: https://lore.kernel.org/linux-arm-kernel/20190613065410.GB16334@mwanda/
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Will Deacon <will@kernel.org>
Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/arm64/iort.c