From patchwork Mon Jun 25 18:22:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Subash Patel X-Patchwork-Id: 9613 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 A283C23E4F for ; Mon, 25 Jun 2012 18:24:00 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 5BFEAA18804 for ; Mon, 25 Jun 2012 18:24:00 +0000 (UTC) Received: by ggnf1 with SMTP id f1so3380186ggn.11 for ; Mon, 25 Jun 2012 11:23:59 -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=G7Zz4AZjBCCQNxVIR2+iYb91BYe2qRCDz1jPbnNjxjcfyzitLjE9r09NnWy4zkB7Qb NQMjLyg+CNykyk/NuccbTokRuLQ57SUIXqO8r87YdKygUZNMJbDzV0cAs13A+1H0WXBY fIz//rZjaEVZN+wEdk7oeRZJ0YAmoLYurgLUHHZSpLVb2VpOhcsMI4mccf8TzEyDWgR5 9FfRZDB3cO3t1Kt2/ft5vhRfQp4SUH9+bTHMYyegM2qtHsiwnMue1GM+fVCZkuf6xT7F T5LDloep7eDzS7fkiloGp9lAveZktHhP1xSnWhwr/lPqZUTwMZs7vnfT9qBns/gt5oJy fi3A== Received: by 10.42.89.72 with SMTP id f8mr6439034icm.33.1340648639594; Mon, 25 Jun 2012 11:23:59 -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 v20csp56544ibb; Mon, 25 Jun 2012 11:23:58 -0700 (PDT) Received: by 10.205.33.136 with SMTP id so8mr4184025bkb.1.1340648638339; Mon, 25 Jun 2012 11:23:58 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id gy9si11595426bkc.120.2012.06.25.11.23.56; Mon, 25 Jun 2012 11:23:58 -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 1SjDx3-00058u-Cl; Mon, 25 Jun 2012 18:23:53 +0000 Received: from mail-pb0-f42.google.com ([209.85.160.42]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SjDx2-00055y-3z for linaro-mm-sig@lists.linaro.org; Mon, 25 Jun 2012 18:23:52 +0000 Received: by mail-pb0-f42.google.com with SMTP id rp12so11608709pbb.1 for ; Mon, 25 Jun 2012 11:23:51 -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=B0veETGv5fPpKdFIBnCcYNmNQSSvXhHtwQspmhxdIaDmm457QJ72jphf2GDmIlbxNY W6OOJjCWb6uKT1ZlRMPRCSOhnGpSxS3Su7QNKlSsMXqgAvYBVMaykX71KawWMqMiZjdL Ea+W/fZQPkT1i5pkqzFhdVD4FZaws5l74qqz652O2XKlKyMKvWEGJvH3pzbmX+8smllJ KXdcnsPjJjJ1Rhv2ziYNpvo+QLvCCaWWNaAC7uIryT2TgWEE1M4LDLi1VrxFT3QEId6S 8YDgNvdtda/M0cKbfLo5JjD0onHhyUNiWKheWn2nsAVmGqCw22SyIpxL6cq707htIXq0 a4jA== Received: by 10.68.191.201 with SMTP id ha9mr44002590pbc.75.1340648631636; Mon, 25 Jun 2012 11:23:51 -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 oc5sm5539749pbb.54.2012.06.25.11.23.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jun 2012 11:23:51 -0700 (PDT) From: Subash Patel To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linaro-mm-sig@lists.linaro.org Date: Mon, 25 Jun 2012 11:22:57 -0700 Message-Id: <1340648577-28402-3-git-send-email-subash.ramaswamy@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1340648577-28402-1-git-send-email-subash.ramaswamy@linaro.org> References: <1340648577-28402-1-git-send-email-subash.ramaswamy@linaro.org> Cc: inki.dae@samsung.com, airlied@redhat.com, olofj@chromium.org, Subash Patel , Subash Patel 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: ALoCoQlaHbVzYfdd2ttc8HOAOPrSpjq/rriCn9L8GGu452QlKiF5wk05YMdyivpJrLN8VzGaKJ8i 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; }