From patchwork Fri Dec 7 12:50:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1853121 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 9BC163FC64 for ; Sat, 8 Dec 2012 18:52:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 903EEE5CEE for ; Sat, 8 Dec 2012 10:52:19 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f49.google.com (mail-bk0-f49.google.com [209.85.214.49]) by gabe.freedesktop.org (Postfix) with ESMTP id DAB13E5C59 for ; Fri, 7 Dec 2012 04:50:24 -0800 (PST) Received: by mail-bk0-f49.google.com with SMTP id jm19so200000bkc.36 for ; Fri, 07 Dec 2012 04:50:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=d6spm/j1dlShOtMFYTLqZmnRqWgNku1bdHNM8+eVXrg=; b=FWg+1rM/+HeWw28vUpzkiLtNhxna5Xe+bAWSCRkqlvSmXHUZnh4+yfpaSQf5SRlL/e 1wvOk2cAyaq8DSLqTC2s/243XTbcs+ZbJWwXvMt7/BmdTdOm8XeFIqus6rlaARbRd/st bYNXAX/7bUp1FzEnhMcvBKDw9y9GUidF9q5fl8nunDdiQ9ZcBA81hHIksW+p02dJ06zd F53003ZJ7DTMqblq0FqGiQeKQLI9lrFQ1ixtcrxpGzKiJ+5/PrbKPSwYdVxOnt48x1z6 cZI7FufyXT4aGiKN80Yywyrb7eUFcjHuVofCDltkcrU0k2NoEiPqOpGOeOg0AIJje7eX 0YwA== MIME-Version: 1.0 Received: by 10.204.149.11 with SMTP id r11mr1806791bkv.93.1354884623834; Fri, 07 Dec 2012 04:50:23 -0800 (PST) Received: by 10.205.26.4 with HTTP; Fri, 7 Dec 2012 04:50:23 -0800 (PST) Date: Fri, 7 Dec 2012 07:50:23 -0500 Message-ID: Subject: [PATCH -next] drm/exynos/iommu: fix return value check in drm_create_iommu_mapping() From: Wei Yongjun To: inki.dae@samsung.com, jy0922.shim@samsung.com, sw0312.kim@samsung.com, kyungmin.park@samsung.com, airlied@linux.ie X-Mailman-Approved-At: Sat, 08 Dec 2012 10:49:22 -0800 Cc: yongjun_wei@trendmicro.com.cn, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Wei Yongjun In case of error, function arm_iommu_create_mapping() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun --- drivers/gpu/drm/exynos/exynos_drm_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c b/drivers/gpu/drm/exynos/exynos_drm_iommu.c index 09db198..3b3d3a6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_iommu.c +++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.c @@ -56,7 +56,7 @@ int drm_create_iommu_mapping(struct drm_device *drm_dev) mapping = arm_iommu_create_mapping(&platform_bus_type, priv->da_start, priv->da_space_size, priv->da_space_order); - if (!mapping) + if (IS_ERR(mapping)) return -ENOMEM; dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),