diff mbox series

[-next] iommu: msm_iommu: Delete useless kfree code

Message ID 20201214134746.5044-1-zhengyongjun3@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] iommu: msm_iommu: Delete useless kfree code | expand

Commit Message

Zheng Yongjun Dec. 14, 2020, 1:47 p.m. UTC
The parameter of kfree function is NULL, so kfree code is useless, delete it.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/iommu/msm_iommu.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Bjorn Andersson Dec. 14, 2020, 4:21 p.m. UTC | #1
On Mon 14 Dec 07:47 CST 2020, Zheng Yongjun wrote:

> The parameter of kfree function is NULL, so kfree code is useless, delete it.
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  drivers/iommu/msm_iommu.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
> index 3615cd6241c4..1286674a1322 100644
> --- a/drivers/iommu/msm_iommu.c
> +++ b/drivers/iommu/msm_iommu.c
> @@ -319,7 +319,7 @@ static struct iommu_domain *msm_iommu_domain_alloc(unsigned type)
>  
>  	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
>  	if (!priv)
> -		goto fail_nomem;
> +		return NULL;
>  
>  	INIT_LIST_HEAD(&priv->list_attached);
>  
> @@ -328,10 +328,6 @@ static struct iommu_domain *msm_iommu_domain_alloc(unsigned type)
>  	priv->domain.geometry.force_aperture = true;
>  
>  	return &priv->domain;
> -
> -fail_nomem:
> -	kfree(priv);
> -	return NULL;
>  }
>  
>  static void msm_iommu_domain_free(struct iommu_domain *domain)
> -- 
> 2.22.0
>
diff mbox series

Patch

diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
index 3615cd6241c4..1286674a1322 100644
--- a/drivers/iommu/msm_iommu.c
+++ b/drivers/iommu/msm_iommu.c
@@ -319,7 +319,7 @@  static struct iommu_domain *msm_iommu_domain_alloc(unsigned type)
 
 	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
 	if (!priv)
-		goto fail_nomem;
+		return NULL;
 
 	INIT_LIST_HEAD(&priv->list_attached);
 
@@ -328,10 +328,6 @@  static struct iommu_domain *msm_iommu_domain_alloc(unsigned type)
 	priv->domain.geometry.force_aperture = true;
 
 	return &priv->domain;
-
-fail_nomem:
-	kfree(priv);
-	return NULL;
 }
 
 static void msm_iommu_domain_free(struct iommu_domain *domain)