From patchwork Wed Jul 6 12:23:05 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: 9217527 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 B08A460752 for ; Thu, 7 Jul 2016 01:09:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0980285AE for ; Thu, 7 Jul 2016 01:09:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 955B1285B0; Thu, 7 Jul 2016 01:09:09 +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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C748285AE for ; Thu, 7 Jul 2016 01:09:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 724266E2A9; Thu, 7 Jul 2016 01:09:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from m12-16.163.com (m12-16.163.com [220.181.12.16]) by gabe.freedesktop.org (Postfix) with ESMTP id 2AE3D6E015 for ; Wed, 6 Jul 2016 12:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=iISu+ nCoYbRhwnw+GV/9XHAdG/X/2mba7FWI5Zp7Vzg=; b=SXjZjkv7iN4rvRQ9huJVr x25LaS7QuUIIF0Yx/2pM7LAelvscHGY/hO+ZpuA3/Eze0KiiUqYRAUmiYyzW6nhi BRfJJNKpJNK9LFK5Wkj2dsOJW+7AbytJP0yQZIYoA14621gWb5M3iuyAZXDQnbxv N9o/wT17IDZUr6MQyrsLwg= Received: from localhost.localdomain.localdomain (unknown [49.77.207.185]) by smtp12 (Coremail) with SMTP id EMCowACHj1cp+HxXhbyIAw--.46834S2; Wed, 06 Jul 2016 20:23:06 +0800 (CST) From: weiyj_lk@163.com To: Ben Skeggs , David Airlie , Stephen Warren , Thierry Reding , Alexandre Courbot Subject: [PATCH -next] drm/nouveau/device: fix return value check in nvkm_device_tegra_probe_iommu() Date: Wed, 6 Jul 2016 12:23:05 +0000 Message-Id: <1467807785-32126-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CM-TRANSID: EMCowACHj1cp+HxXhbyIAw--.46834S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr4DZryfGF4rKF4rZr45trb_yoWDXFgEkF 4xZr43uryFkFs2vF45Ar43XryfK3s8ZrWSv342qwn3J34UXr4fJwnrur15Zr13Ga4v9FWq y3WDZFWayrnxWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnQ_-DUUUUU== X-Originating-IP: [49.77.207.185] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiJQqe1lUMAoX96gAAsu X-Mailman-Approved-At: Thu, 07 Jul 2016 01:08:42 +0000 Cc: linux-tegra@vger.kernel.org, nouveau@lists.freedesktop.org, Wei Yongjun , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function iommu_domain_alloc() 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 --- drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c index ec12efb..2ed025d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c @@ -102,7 +102,7 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) if (iommu_present(&platform_bus_type)) { tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type); - if (IS_ERR(tdev->iommu.domain)) + if (!tdev->iommu.domain) goto error; /*