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: 9217741 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 2AB3560467 for ; Thu, 7 Jul 2016 03:00:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13F4C28657 for ; Thu, 7 Jul 2016 03:00:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04DF628659; Thu, 7 Jul 2016 03:00:21 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB2C628657 for ; Thu, 7 Jul 2016 03:00:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751635AbcGGDAT (ORCPT ); Wed, 6 Jul 2016 23:00:19 -0400 Received: from m12-11.163.com ([220.181.12.11]:53512 "EHLO m12-11.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751504AbcGGDAS (ORCPT ); Wed, 6 Jul 2016 23:00:18 -0400 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 Cc: Wei Yongjun , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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