Skip to content

Commit 0b31316

Browse files
nicolincgregkh
authored andcommitted
iommufd/selftest: Fix ioctl return value in _test_cmd_trigger_vevents()
[ Upstream commit b09ed52 ] The ioctl returns 0 upon success, so !0 returning -1 breaks the selftest. Drop the '!' to fix it. Fixes: 1d235d8 ("iommu/selftest: prevent use of uninitialized variable") Link: https://patch.msgid.link/r/[email protected] Signed-off-by: Nicolin Chen <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 8ac42a6 commit 0b31316

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/iommu/iommufd_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,8 +1044,8 @@ static int _test_cmd_trigger_vevents(int fd, __u32 dev_id, __u32 nvevents)
10441044
};
10451045

10461046
while (nvevents--) {
1047-
if (!ioctl(fd, _IOMMU_TEST_CMD(IOMMU_TEST_OP_TRIGGER_VEVENT),
1048-
&trigger_vevent_cmd))
1047+
if (ioctl(fd, _IOMMU_TEST_CMD(IOMMU_TEST_OP_TRIGGER_VEVENT),
1048+
&trigger_vevent_cmd))
10491049
return -1;
10501050
}
10511051
return 0;

0 commit comments

Comments
 (0)