From patchwork Mon Jun 25 18:16:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Subash Patel X-Patchwork-Id: 9611 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6029223F43 for ; Mon, 25 Jun 2012 18:17:07 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1B02DA189E8 for ; Mon, 25 Jun 2012 18:17:07 +0000 (UTC) Received: by ghbz12 with SMTP id z12so3374580ghb.11 for ; Mon, 25 Jun 2012 11:17:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:from:to:date:message-id:x-mailer:in-reply-to :references:cc:subject:x-beenthere:x-mailman-version:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:mime-version:content-type:content-transfer-encoding :sender:errors-to:x-gm-message-state; bh=IdxU3wyYUU6c4T1bPVN+8M45iErJZBx0hTJMD871XCE=; b=b07gkcyM78XT58zJhImvt5jjGbYkXHMCxUsUxaYqQdVK8RFXNvjjt8PHowHBEqLind 50pxZF20cDrzVvT/mn1CqfmaP2LuAfSGhUVhoWtLn3gL9fFqj84QSpD7v6gszRo07Ggt fizp25MELOdYAD1pg6LjsVTBfyn4+uONvlFsCr0MhGcePklbVkPPgjSq3BRrW5aQFGQ9 Nk72DM08YfgEJygp5zF1fdH8UF4Z3kp00t0eO7MQgBrvhWRpgyvE0ImPiPc/UaHoTteM XnWUR+YHrQ5iEWrhmjbBFRYywazOOYmxTVZRqHqWZhDsQzYBks1C3aSiMcgk3QyS0fAJ ar2w== Received: by 10.42.155.73 with SMTP id t9mr6275918icw.48.1340648223755; Mon, 25 Jun 2012 11:17:03 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp56350ibb; Mon, 25 Jun 2012 11:17:03 -0700 (PDT) Received: by 10.216.228.88 with SMTP id e66mr6857021weq.208.1340648222045; Mon, 25 Jun 2012 11:17:02 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id m20si12878375wiw.20.2012.06.25.11.17.00; Mon, 25 Jun 2012 11:17:02 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SjDqN-0003OC-EV; Mon, 25 Jun 2012 18:16:59 +0000 Received: from mail-pb0-f42.google.com ([209.85.160.42]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SjDqM-0003Nf-QQ for linaro-mm-sig@lists.linaro.org; Mon, 25 Jun 2012 18:16:59 +0000 Received: by pbbrp12 with SMTP id rp12so11597800pbb.1 for ; Mon, 25 Jun 2012 11:16:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=lunv1elpQr2b/Y+i0XyTsBrUgt9d1z4F3h9gVGnkEmg=; b=s7TKFaLriLPnQbiykm+irL8kXVljUmM1vm8S96T7lyTV6wv48pPydlGmbZBkzyOheX PehYgobS0Z8gWgRaF1mU48THuoTgnRwwhZBLuFyq7nffaYC8xFGb6yaRdMSrRjzepcct IrvlnSWjkTztOcMHN2WUaV+Al/LHargAXZhhe8IAvju9Qlpg/ibqebaLbK0c7M2ki1zN 1DpRW/k4k6RUexte4md2tbyc1kTXVvFUWOkuN4US15uKIuFtUyJU2rRdjSJjQjfOrX5M Tx3eOVIvYJ2m7Bjs+/LZQesocnM+kajMd/X72sYn5DPS4r63gOGDSF+bdp/wgCuBS2Nf Ly6w== Received: by 10.68.221.72 with SMTP id qc8mr43344743pbc.63.1340648215810; Mon, 25 Jun 2012 11:16:55 -0700 (PDT) Received: from localhost.localdomain (dhcp-172-22-52-171.mtv.corp.google.com [172.22.52.171]) by mx.google.com with ESMTPS id os3sm9192193pbb.41.2012.06.25.11.16.54 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jun 2012 11:16:55 -0700 (PDT) From: Subash Patel To: subash.ramaswamy@linaro.org Date: Mon, 25 Jun 2012 11:16:22 -0700 Message-Id: <1340648182-28329-3-git-send-email-subash.ramaswamy@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1340648182-28329-1-git-send-email-subash.ramaswamy@linaro.org> References: <1340648182-28329-1-git-send-email-subash.ramaswamy@linaro.org> Cc: inki.dae@samsung.com, Subash Patel , linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, airlied@redhat.com, olofj@chromium.org Subject: [Linaro-mm-sig] [PATCH 2/2] DRM: Exynos: check for null in return value of dma_buf_map_attachment() X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQlV9KZHkhtI1v6wWcr3Eh8bAfZOzWHJlBs0TvYtBQhzG4XYoXJMiPf2wcPWkAMVfrG6/59A From: Subash Patel dma_buf_map_attachment() can return NULL and valid sg as return value. Hence the check for the returned scatter-gather must be using the inline function IS_ERR_OR_NULL() in place of IS_ERR() Change-Id: I33218480e220f6a26a1e726b336bf533a95363de Signed-off-by: Subash Patel CC: dri-devel@lists.freedesktop.org CC: linux-samsung-soc@vger.kernel.org CC: linaro-mm-sig@lists.linaro.org CC: inki.dae@samsung.com CC: airlied@redhat.com CC: olofj@chromium.org --- drivers/gpu/drm/exynos/exynos_drm_dmabuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c index 52cf761..c908a29 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c @@ -245,7 +245,7 @@ struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev, sgt = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL); - if (IS_ERR(sgt)) { + if (IS_ERR_OR_NULL(sgt)) { ret = PTR_ERR(sgt); goto err_buf_detach; }