Skip to content

Commit 595572a

Browse files
LuBaolujgunthorpe
authored andcommitted
iommufd: Fix error pointer checking
Smatch static checker reported below warning: drivers/iommu/iommufd/fault.c:131 iommufd_device_get_attach_handle() warn: 'handle' is an error pointer or valid Fix it by checking 'handle' with IS_ERR(). Fixes: b7d8833 ("iommufd: Fault-capable hwpt attach/detach/replace") Link: https://lore.kernel.org/r/[email protected] Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/linux-iommu/[email protected]/ Signed-off-by: Lu Baolu <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent d73cf5f commit 595572a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/iommufd/fault.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ iommufd_device_get_attach_handle(struct iommufd_device *idev)
128128
struct iommu_attach_handle *handle;
129129

130130
handle = iommu_attach_handle_get(idev->igroup->group, IOMMU_NO_PASID, 0);
131-
if (!handle)
131+
if (IS_ERR(handle))
132132
return NULL;
133133

134134
return to_iommufd_handle(handle);

0 commit comments

Comments
 (0)