Skip to content

Commit e7628fa

Browse files
committed
iommufd/selftest: Fix ioctl return value in _test_cmd_trigger_vevents()
JIRA: https://issues.redhat.com/browse/RHEL-116573 Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd.git commit b09ed52 Author: Nicolin Chen <nicolinc@nvidia.com> Date: Tue Oct 14 14:48:46 2025 -0700 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> Signed-off-by: Eder Zulian <ezulian@redhat.com>
1 parent 3b46495 commit e7628fa

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)