]> Gentwo Git Trees - linux/.git/commit
iommufd: Fix error pointer checking
authorLu Baolu <baolu.lu@linux.intel.com>
Fri, 12 Jul 2024 02:58:19 +0000 (10:58 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 12 Jul 2024 12:51:25 +0000 (09:51 -0300)
commit595572aae3d0c3bf295ea759b74b948e7493a9ff
treed8e9ddc6d5d4d7d4f4ac5b31ce9ffbfc0b090996
parentd73cf5ff743b5a8de6fa20651baba5bd56ba98a3
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: b7d8833677ba ("iommufd: Fault-capable hwpt attach/detach/replace")
Link: https://lore.kernel.org/r/20240712025819.63147-1-baolu.lu@linux.intel.com
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-iommu/8bb4f37a-4514-4dea-aabb-7380be303895@stanley.mountain/
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/fault.c