From patchwork Thu Jul 7 12:17:33 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: 9218867 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 2C83D60574 for ; Thu, 7 Jul 2016 12:18:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B0EC288CB for ; Thu, 7 Jul 2016 12:18:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0EE24288CC; Thu, 7 Jul 2016 12:18:50 +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 833B3288B9 for ; Thu, 7 Jul 2016 12:18:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750899AbcGGMSs (ORCPT ); Thu, 7 Jul 2016 08:18:48 -0400 Received: from m12-11.163.com ([220.181.12.11]:39099 "EHLO m12-11.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750725AbcGGMSs (ORCPT ); Thu, 7 Jul 2016 08:18:48 -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=maZKd d5rP90VRbkUSNZ0CjK1om+NLBkHwy4M6XoNQ48=; b=iokf9kW1OAk4zBuqf1bNK d5xtLHzbX2frrmCR37Ta390Y7FNCU1Y/CkyQTWE3TZ3S78lFiv8PGA1CZL/XvRT7 dKHgbIon5FdGe1ArVTbZWhEOsJgstTcBl15u0nXq0lmyMsStSPXW7AGpP0M7pXn0 pNlVHZ7NwQEvsQCDa+vUJ4= Received: from localhost.localdomain.localdomain (unknown [49.77.207.185]) by smtp7 (Coremail) with SMTP id C8CowADH9rpdSH5XOmhMBw--.53598S2; Thu, 07 Jul 2016 20:17:35 +0800 (CST) From: weiyj_lk@163.com To: Marek Szyprowski , Joerg Roedel , Kukjin Kim , Krzysztof Kozlowski , Dennis Chen , Andi Shyti Cc: Wei Yongjun , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH -next v3] iommu/exynos: Fix return value check in exynos_iommu_of_setup() Date: Thu, 7 Jul 2016 12:17:33 +0000 Message-Id: <1467893853-21403-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467860372-6940-1-git-send-email-weiyj_lk@163.com> References: <1467860372-6940-1-git-send-email-weiyj_lk@163.com> MIME-Version: 1.0 X-CM-TRANSID: C8CowADH9rpdSH5XOmhMBw--.53598S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7Wr4kGry8KrykXFy8XF4UCFg_yoW8JF13pa 17Ga4qyFy8Jay8ta4xA3yUZFyYvanFka40vrWfC398ur4Yqryj93sagFyrKwn7CrW8G3WS va1jvF4xua15A3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jpAp8UUUUU= X-Originating-IP: [49.77.207.185] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiGR+f1lXlTwHgrAAAs9 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. Fixes: 8ed55c812fa8 ("iommu/exynos: Init from dt-specific callback instead of initcall") Cc: stable@vger.kernel.org Signed-off-by: Wei Yongjun Reviewed-by: Andi Shyti Reviewed-by: Krzysztof Kozlowski Reviewed-by: Dennis Chen --- v2 -> v3: added fixes and Reviewed-by. --- 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