diff options
author | Wen Yang <[email protected]> | 2018-11-29 14:01:50 +0800 |
---|---|---|
committer | Sean Paul <[email protected]> | 2018-12-03 08:46:14 -0500 |
commit | 098336deb946f37a70afc0979af388b615c378bf (patch) | |
tree | 77fe6a8a96a9807b347c53ca3512f75ac5b84eb5 | |
parent | d9a75a6201d9367a452de59d7759b708633f1a1f (diff) |
drm/msm: Fix error return checking
The error checks on ret for a negative error return always fails because
the return value of iommu_map_sg() is unsigned and can never be negative.
Detected with Coccinelle:
drivers/gpu/drm/msm/msm_iommu.c:69:9-12: WARNING: Unsigned expression
compared with zero: ret < 0
Signed-off-by: Wen Yang <[email protected]>
CC: Rob Clark <[email protected]>
CC: David Airlie <[email protected]>
CC: Julia Lawall <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
Signed-off-by: Sean Paul <[email protected]>
-rw-r--r-- | drivers/gpu/drm/msm/msm_iommu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c index b23d33622f37..2a90aa4caec0 100644 --- a/drivers/gpu/drm/msm/msm_iommu.c +++ b/drivers/gpu/drm/msm/msm_iommu.c @@ -66,7 +66,7 @@ static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova, // pm_runtime_get_sync(mmu->dev); ret = iommu_map_sg(iommu->domain, iova, sgt->sgl, sgt->nents, prot); // pm_runtime_put_sync(mmu->dev); - WARN_ON(ret < 0); + WARN_ON(!ret); return (ret == len) ? 0 : -EINVAL; } |