From patchwork Fri Jun 14 09:03:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 2720641 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2D4249F8E4 for ; Fri, 14 Jun 2013 09:03:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 04FBD201EC for ; Fri, 14 Jun 2013 09:03:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 21F03201B9 for ; Fri, 14 Jun 2013 09:03:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 18C3CE623C for ; Fri, 14 Jun 2013 02:03:45 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by gabe.freedesktop.org (Postfix) with ESMTP id E8348E5C9A for ; Fri, 14 Jun 2013 02:03:33 -0700 (PDT) Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MOD004W9L5WI7O0@mailout3.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 14 Jun 2013 18:03:32 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.115]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 76.9D.17404.46CDAB15; Fri, 14 Jun 2013 18:03:32 +0900 (KST) X-AuditID: cbfee68d-b7f096d0000043fc-a1-51badc64f3c1 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 84.9A.21068.36CDAB15; Fri, 14 Jun 2013 18:03:32 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.90.8.53]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MOD00L74L5V9D50@mmp2.samsung.com>; Fri, 14 Jun 2013 18:03:31 +0900 (KST) From: Inki Dae To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: make sure to handle an error case to vm_mmap call Date: Fri, 14 Jun 2013 18:03:31 +0900 Message-id: <1371200611-24822-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.5.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrOLMWRmVeSWpSXmKPExsWyRsSkWDflzq5AgxXveSyufH3PZjHp/gQW ixf3LrJYnG16w24xY/JLNgdWj/vdx5k8+rasYgxgiuKySUnNySxLLdK3S+DKePF8OUvBK56K R/tXsTcw3uPqYuTkkBAwkVjXuoEFwhaTuHBvPVsXIxeHkMBSRonXC08ywxS9fnGECSIxnVFi eddqZgini0li/qOTYO1sAqoSE1fcZwOxRQSUJf5OXMUIYjMLpEl8/76XHcQWFvCT+LTmKlic Baj+68vDYPW8Ai4S+w4cYoTYpiDx68gqVpAFEgL32STe31zKCtEgIPFt8iGgZRxACVmJTQeg rpOUOLjiBssERsEFjAyrGEVTC5ILipPSiwz1ihNzi0vz0vWS83M3MQID8fS/Z707GG8fsD7E mAw0biKzlGhyPjCQ80riDY3NjCxMTUyNjcwtzUgTVhLnVWuxDhQSSE8sSc1OTS1ILYovKs1J LT7EyMTBKdXAKL7gV7VwyE3H1Q/tDvu6XRBf8OVt8oHiF7Hvt54tm+Y42VVe/nx/ndWlfw7l i5/lGH1iS76S5e8U+91zc2ptSe3nqQ0thSv7HvBpbVaYEmC7V21C86bTrddLGg5dVvifkvcg YE/emgqL43vvGn382lFzly1HzeP6zkf3T3yQNDh9WeR/yIeCuUosxRmJhlrMRcWJAP82Otxa AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRmVeSWpSXmKPExsVy+t9jQd2UO7sCDS58Z7W48vU9m8Wk+xNY LF7cu8hicbbpDbvFjMkv2RxYPe53H2fy6NuyijGAKaqB0SYjNTEltUghNS85PyUzL91WyTs4 3jne1MzAUNfQ0sJcSSEvMTfVVsnFJ0DXLTMHaJ+SQlliTilQKCCxuFhJ3w7ThNAQN10LmMYI Xd+QILgeIwM0kLCGMePF8+UsBa94Kh7tX8XewHiPq4uRk0NCwETi9YsjTBC2mMSFe+vZuhi5 OIQEpjNKLO9azQzhdDFJzH90kgWkik1AVWLiivtsILaIgLLE34mrGEFsZoE0ie/f97KD2MIC fhKf1lwFi7MA1X99eRisnlfARWLfgUOMENsUJH4dWcU6gZF7ASPDKkbR1ILkguKk9FwjveLE 3OLSvHS95PzcTYzgMH8mvYNxVYPFIUYBDkYlHt6ECzsDhVgTy4orcw8xSnAwK4nwhv8FCvGm JFZWpRblxxeV5qQWH2JMBto+kVlKNDkfGIN5JfGGxiZmRpZG5oYWRsbmpAkrifMebLUOFBJI TyxJzU5NLUgtgtnCxMEp1cAY4XbkqXTPhCf72nM+NBzJLbnDbHro5mzPNUdu7Fe0ZRKv/RMW s3UGu5uVqaNlWYfnTnNxka5t8/2fix38vqr80/yZpxu8+1ezudUcLWE0zpGZdWzqkkcLF7St Uthybv8jJ26hbTm5Liv3q//yFb24bXVBONslzwbVMH6e1+H7uG4vFV6xVG+/EktxRqKhFnNR cSIAf8M66rcCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: kyungmin.park@samsung.com, sw0312.kim@samsung.com 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: , MIME-Version: 1.0 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 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP vm_mmap function returns unsigned long so addr type should be unsigned long. a pointer or address variable is required to use unsigned long or uint64_t type for 64bits address support. So this patch makes sure that addr has unsigned long type and also exynos_drm_gem_mmap_ioctl returns correct error type. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 5af1478..c3f15e7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -420,7 +420,7 @@ int exynos_drm_gem_mmap_ioctl(struct drm_device *dev, void *data, { struct drm_exynos_gem_mmap *args = data; struct drm_gem_object *obj; - unsigned int addr; + unsigned long addr; if (!(dev->driver->driver_features & DRIVER_GEM)) { DRM_ERROR("does not support GEM.\n"); @@ -462,14 +462,14 @@ int exynos_drm_gem_mmap_ioctl(struct drm_device *dev, void *data, drm_gem_object_unreference(obj); - if (IS_ERR((void *)addr)) { + if (IS_ERR_VALUE(addr)) { /* check filp->f_op, filp->private_data are restored */ if (file_priv->filp->f_op == &exynos_drm_gem_fops) { file_priv->filp->f_op = fops_get(dev->driver->fops); file_priv->filp->private_data = file_priv; } mutex_unlock(&dev->struct_mutex); - return PTR_ERR((void *)addr); + return (int)addr; } mutex_unlock(&dev->struct_mutex);