From patchwork Thu Jul 7 02:59:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: weiyj_lk@163.com X-Patchwork-Id: 9217747 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BBE5B60467 for ; Thu, 7 Jul 2016 03:01:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFA5D28659 for ; Thu, 7 Jul 2016 03:01:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3BE32865B; Thu, 7 Jul 2016 03:01:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 410E428659 for ; Thu, 7 Jul 2016 03:01:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bKzXr-00032d-RY; Thu, 07 Jul 2016 03:00:07 +0000 Received: from m12-11.163.com ([220.181.12.11]) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bKzXp-0001sp-8B for linux-arm-kernel@lists.infradead.org; Thu, 07 Jul 2016 03:00:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=gMThk pG11Sa4dmbi4zdmTIHkLCni2wtuHS9d3LwsJs8=; b=Mby2VuUL4UlsZoxw8jn3+ 18WGvYvr/9eW2guUrF0AK68C4XnDqLH1t6NHph9HBpxYILkLhhneeXEMqbOIadIu pI6UCj8IqMd7qhkPVMOKvyBkDOmg6YdxN4y2nOI8wIiNC+n7pslod0PkhvNb96iu tVdbn6NyI2bSpZNNMkXriw= Received: from localhost.localdomain.localdomain (unknown [49.77.207.185]) by smtp7 (Coremail) with SMTP id C8CowAC3zDmUxX1X5nguBw--.52766S2; Thu, 07 Jul 2016 10:59:33 +0800 (CST) From: weiyj_lk@163.com To: Marek Szyprowski , Joerg Roedel , Kukjin Kim , Krzysztof Kozlowski Subject: [PATCH -next v2] iommu/exynos: Fix return value check in exynos_iommu_of_setup() Date: Thu, 7 Jul 2016 02:59:32 +0000 Message-Id: <1467860372-6940-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467807354-26503-1-git-send-email-weiyj_lk@163.com> References: <1467807354-26503-1-git-send-email-weiyj_lk@163.com> MIME-Version: 1.0 X-CM-TRANSID: C8CowAC3zDmUxX1X5nguBw--.52766S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr4kGry8KrW7Gw4fXw48Crg_yoWDJrc_KF 1rZwnrXr1Y9w4vvF42grsxZr9Iyasxurs3WFWIg343XryDXr4ftrWUZryIyFWfWw40yFZx KwnxCr1fAry7KjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnBwZ7UUUUU== X-Originating-IP: [49.77.207.185] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiJRWf1lUMApBZzgAAsl X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160706_200005_627225_BB8A2116 X-CRM114-Status: GOOD ( 11.78 ) 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: Wei Yongjun , linux-samsung-soc@vger.kernel.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function of_platform_device_create() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun Reviewed-by: Andi Shyti --- v1 -> v2: chenge the error code to -ENODEV --- drivers/iommu/exynos-iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 33dcc29..9b23059 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np) exynos_iommu_init(); pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root); - if (IS_ERR(pdev)) - return PTR_ERR(pdev); + if (!pdev) + return -ENODEV; /* * use the first registered sysmmu device for performing