Re: [PATCH] iommu/arm-smmu: Axe a useless test in 'arm_smmu_master_alloc_smes()'

From: Christophe JAILLET
Date: Mon Sep 16 2019 - 15:43:51 EST


Le 16/09/2019 Ã 12:46, Robin Murphy a ÃcritÂ:
On 15/09/2019 20:34, Christophe JAILLET wrote:
'ommu_group_get_for_dev()' never returns NULL, so this test can be removed.

Nit: typo in the function name.

Otherwise, there definitely used to be some path where a NULL return could leak out, so I would have had that in mind at the time I wrote this, but apparently I never noticed that that had already been cleaned up by the time this got merged.

Hi,

Maybe fixed by 72dcac633475 ("iommu: Warn once when device_group callback returns NULL")


CJ

Reviewed-by: Robin Murphy <robin.murphy@xxxxxxx>

Thanks,
Robin.

Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
 drivers/iommu/arm-smmu.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index c3ef0cc8f764..6fae8cdbe985 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -1038,8 +1038,6 @@ static int arm_smmu_master_alloc_smes(struct device *dev)
ÂÂÂÂÂ }
 Â group = iommu_group_get_for_dev(dev);
-ÂÂÂ if (!group)
-ÂÂÂÂÂÂÂ group = ERR_PTR(-ENOMEM);
ÂÂÂÂÂ if (IS_ERR(group)) {
ÂÂÂÂÂÂÂÂÂ ret = PTR_ERR(group);
ÂÂÂÂÂÂÂÂÂ goto out_err;