public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/rockchip: Don't feed NULL res pointers to devres
@ 2016-03-21 11:00 Tomeu Vizoso
  2016-03-21 12:38 ` Javier Martinez Canillas
  2016-04-05 14:27 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Tomeu Vizoso @ 2016-03-21 11:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tomeu Vizoso, Joerg Roedel, Heiko Stuebner, iommu,
	linux-arm-kernel, linux-rockchip

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(+)

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;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-05 14:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-21 11:00 [PATCH] iommu/rockchip: Don't feed NULL res pointers to devres Tomeu Vizoso
2016-03-21 12:38 ` Javier Martinez Canillas
2016-04-05 14:27 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox