Skip to content

Commit b09ed52

Browse files
nicolincjgunthorpe
authored andcommitted
iommufd/selftest: Fix ioctl return value in _test_cmd_trigger_vevents()
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/20251014214847.1113759-1-nicolinc@nvidia.com Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent cb30dfa commit b09ed52

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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)