drm/exynos: Properly propagate return value in drm_iommu_attach_device()
diff mbox series

Message ID 20200522060356.25153-1-m.szyprowski@samsung.com
State Not Applicable
Headers show
Series
  • drm/exynos: Properly propagate return value in drm_iommu_attach_device()
Related show

Commit Message

Marek Szyprowski May 22, 2020, 6:03 a.m. UTC
Propagate the proper error codes from the called functions instead of
unconditionally returning 0.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Inki Dae June 1, 2020, 8:10 a.m. UTC | #1
20. 5. 22. 오후 3:03에 Marek Szyprowski 이(가) 쓴 글:
> Propagate the proper error codes from the called functions instead of
> unconditionally returning 0.
> 

Picked it up.

Thanks,
Inki Dae

> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_dma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dma.c b/drivers/gpu/drm/exynos/exynos_drm_dma.c
> index d3fe6c1e6688..5887f7f52f96 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_dma.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c
> @@ -44,7 +44,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev,
>  				struct device *subdrv_dev, void **dma_priv)
>  {
>  	struct exynos_drm_private *priv = drm_dev->dev_private;
> -	int ret;
> +	int ret = 0;
>  
>  	if (get_dma_ops(priv->dma_dev) != get_dma_ops(subdrv_dev)) {
>  		DRM_DEV_ERROR(subdrv_dev, "Device %s lacks support for IOMMU\n",
> @@ -69,7 +69,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev,
>  		ret = iommu_attach_device(priv->mapping, subdrv_dev);
>  	}
>  
> -	return 0;
> +	return ret;
>  }
>  
>  /*
>

Patch
diff mbox series

diff --git a/drivers/gpu/drm/exynos/exynos_drm_dma.c b/drivers/gpu/drm/exynos/exynos_drm_dma.c
index d3fe6c1e6688..5887f7f52f96 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dma.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c
@@ -44,7 +44,7 @@  static int drm_iommu_attach_device(struct drm_device *drm_dev,
 				struct device *subdrv_dev, void **dma_priv)
 {
 	struct exynos_drm_private *priv = drm_dev->dev_private;
-	int ret;
+	int ret = 0;
 
 	if (get_dma_ops(priv->dma_dev) != get_dma_ops(subdrv_dev)) {
 		DRM_DEV_ERROR(subdrv_dev, "Device %s lacks support for IOMMU\n",
@@ -69,7 +69,7 @@  static int drm_iommu_attach_device(struct drm_device *drm_dev,
 		ret = iommu_attach_device(priv->mapping, subdrv_dev);
 	}
 
-	return 0;
+	return ret;
 }
 
 /*