diff mbox

iommu/rockchip: Don't feed NULL res pointers to devres

Message ID 1458558024-6922-1-git-send-email-tomeu.vizoso@collabora.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomeu Vizoso March 21, 2016, 11 a.m. UTC
If we do, devres prints a "invalid resource" string in the error
loglevel.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---
 drivers/iommu/rockchip-iommu.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Javier Martinez Canillas March 21, 2016, 12:38 p.m. UTC | #1
Hello Tomeu,

On Mon, Mar 21, 2016 at 8:00 AM, Tomeu Vizoso
<tomeu.vizoso@collabora.com> wrote:
> If we do, devres prints a "invalid resource" string in the error
> loglevel.
>
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> ---

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>

Best regards,
Javier
Joerg Roedel April 5, 2016, 2:27 p.m. UTC | #2
On Mon, Mar 21, 2016 at 12:00:23PM +0100, Tomeu Vizoso wrote:
> If we do, devres prints a "invalid resource" string in the error
> loglevel.
> 
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> ---
>  drivers/iommu/rockchip-iommu.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index a6f593a0a29e..0253ab35c33b 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -1049,6 +1049,8 @@  static int rk_iommu_probe(struct platform_device *pdev)
 
 	for (i = 0; i < pdev->num_resources; i++) {
 		res = platform_get_resource(pdev, IORESOURCE_MEM, i);
+		if (!res)
+			continue;
 		iommu->bases[i] = devm_ioremap_resource(&pdev->dev, res);
 		if (IS_ERR(iommu->bases[i]))
 			continue;