From patchwork Mon Dec 10 07:11:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1856231 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 277FCDFB79 for ; Mon, 10 Dec 2012 09:12:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2269AE5FF4 for ; Mon, 10 Dec 2012 01:12:49 -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 4A98EE5C87 for ; Sun, 9 Dec 2012 23:11:14 -0800 (PST) Received: by mail-bk0-f49.google.com with SMTP id jm19so873512bkc.36 for ; Sun, 09 Dec 2012 23:11:14 -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=Ve5CbNq6FhTJBkWXYdRWSWijTUPijvfH/suvSYutHdc=; b=GR4tHRMFLhayQ60v017mmPklYg+t3W4WCPDd/SNzCl1iW56PXxJLfCVakJq3QyR3n9 EkRU//lzYrFTD1bEgjm7jkYiU+lqJDbPih/Yfr5EW+dZ9g3xVZkZ0XUK1L4WHYeSGIN7 oEeG9fgzXRSg67Pk3729ZxQRTxuovfNvOT75OepON5BIcVSnJoE8kuC5dLyh6oNVgcOa hJdmzctffJjE9A5gqg3l2IFFy92mlieeRWwNwYxixGTEGHk5xkm76WX9S1n2UTqGvxbS MEXZouUeMinUqDO5BcS3a9ClocASCBUNn9Zh4RbKuMgXta1qeZ80Up0tYtKSX1Ny7kLj ckvQ== MIME-Version: 1.0 Received: by 10.204.149.149 with SMTP id t21mr3954775bkv.85.1355123473894; Sun, 09 Dec 2012 23:11:13 -0800 (PST) Received: by 10.205.26.4 with HTTP; Sun, 9 Dec 2012 23:11:13 -0800 (PST) Date: Mon, 10 Dec 2012 02:11:13 -0500 Message-ID: Subject: [PATCH -next v2] 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: Mon, 10 Dec 2012 01:09:00 -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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_iommu.c b/drivers/gpu/drm/exynos/exynos_drm_iommu.c index 09db198..2482b7f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_iommu.c +++ b/drivers/gpu/drm/exynos/exynos_drm_iommu.c @@ -56,8 +56,8 @@ 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) - return -ENOMEM; + if (IS_ERR(mapping)) + return PTR_ERR(mapping); dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms), GFP_KERNEL);