Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754593AbcCULA5 (ORCPT ); Mon, 21 Mar 2016 07:00:57 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:38734 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754493AbcCULAt (ORCPT ); Mon, 21 Mar 2016 07:00:49 -0400 From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Cc: Tomeu Vizoso , Joerg Roedel , Heiko Stuebner , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH] iommu/rockchip: Don't feed NULL res pointers to devres Date: Mon, 21 Mar 2016 12:00:23 +0100 Message-Id: <1458558024-6922-1-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 728 Lines: 23 If we do, devres prints a "invalid resource" string in the error loglevel. Signed-off-by: Tomeu Vizoso --- 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