From patchwork Mon Mar 21 11:00:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8631611 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5B3FA9F372 for ; Mon, 21 Mar 2016 11:07:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B7FB200F2 for ; Mon, 21 Mar 2016 11:07:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B1269200DF for ; Mon, 21 Mar 2016 11:07:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ahxaE-0007ne-BS; Mon, 21 Mar 2016 11:01:14 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ahxa9-00079W-O9; Mon, 21 Mar 2016 11:01:10 +0000 Received: by mail-wm0-x231.google.com with SMTP id l68so104809484wml.0; Mon, 21 Mar 2016 04:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=RvwJDLTLiBAKXnT+T8rjywzfYVLhvznwXM3wDEzpgfA=; b=bmY13Fqp2d+Hlj0y14foLF7HwKtAfq/Wce/gh6ReY/+mTznoyzQR4pV9t1K1DXn0bm eK6cJo4biFlAZCyWCwfaIX7qww2G1np4+7iAYBoDIPOOuk45E0P9lzp2BlvDUediONEy 7nLP2qRaebd9UdMAKao0WSijrW7i++puTrCOo3Rym1xvKlqc9rueI1zqCTOahWUkziPX 1PfEerfF6c+RCKz+h1gZjeLyfZqBrllgfFKRkwerVC7W+CNj5/V38F9B1OFBKh0LEDCy 3bFF1m7FebkTgXzffHqiHo/x9EDfZceArFFDWVSht8gyN6JXyt9G21E4UML1TkPDQV1v a6MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=RvwJDLTLiBAKXnT+T8rjywzfYVLhvznwXM3wDEzpgfA=; b=fNQwHxm2m3agE/I3l2YfNaSbozdim59MbS7GFJPNM+nm2rnSA1RyK6kSfLlnfpnV4s Q4CxOsigQ2aT6NhKoueGFqUTtCgxL9kro0Z07H5+8RKUYSy55q8iRY9LG9B2ZYWqus3S Z7MIzByobwjVeb+EmcLxlegHVs/B0t0U7qIe3tuct10Y3ejSavpMTq2vwMGKuO/vZYqn gNhXwK0IpicMyWZDpyUTapb9XW2xq9+gTMMtlRstx1G7ZCAkGDsR2tgdvaJMsvrOPSgs 1T+Duw5yr0wVCYqt53wQCBV4U19G9oErVdjoELlAH6q7qK6tZriPQVPrYni4RJI/wz/f wJbA== X-Gm-Message-State: AD7BkJIYf4UKIzxOOnwNbYNUJdGlyzubwEnHKTNS/HsOOm5gbfbQLiKZ8wZw9Wmq115PXw== X-Received: by 10.28.184.148 with SMTP id i142mr13723354wmf.22.1458558047765; Mon, 21 Mar 2016 04:00:47 -0700 (PDT) Received: from cizrna.lan ([109.72.12.28]) by smtp.gmail.com with ESMTPSA id n66sm11944106wmg.20.2016.03.21.04.00.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Mar 2016 04:00:46 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160321_040110_090804_E314B22A X-CRM114-Status: UNSURE ( 9.03 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.4 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , Tomeu Vizoso , Joerg Roedel , linux-rockchip@lists.infradead.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If we do, devres prints a "invalid resource" string in the error loglevel. Signed-off-by: Tomeu Vizoso Reviewed-by: Javier Martinez Canillas --- 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;