aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2013-06-14 04:54:27 -0400
committerInki Dae <daeinki@gmail.com>2013-06-28 08:13:56 -0400
commit23f340e0314eab461d33ae91250f9b47af23918f (patch)
treec0fd433e18b16354cc66976e0de61c543a195cb8
parent2fa7b74c7b39b66c378be151a854e0b8a705765c (diff)
drm/exynos: make sure to handle an error case to vm_mmap call
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 <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_gem.c6
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 5af14782fcfe..c3f15e7646d5 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,
420{ 420{
421 struct drm_exynos_gem_mmap *args = data; 421 struct drm_exynos_gem_mmap *args = data;
422 struct drm_gem_object *obj; 422 struct drm_gem_object *obj;
423 unsigned int addr; 423 unsigned long addr;
424 424
425 if (!(dev->driver->driver_features & DRIVER_GEM)) { 425 if (!(dev->driver->driver_features & DRIVER_GEM)) {
426 DRM_ERROR("does not support GEM.\n"); 426 DRM_ERROR("does not support GEM.\n");
@@ -462,14 +462,14 @@ int exynos_drm_gem_mmap_ioctl(struct drm_device *dev, void *data,
462 462
463 drm_gem_object_unreference(obj); 463 drm_gem_object_unreference(obj);
464 464
465 if (IS_ERR((void *)addr)) { 465 if (IS_ERR_VALUE(addr)) {
466 /* check filp->f_op, filp->private_data are restored */ 466 /* check filp->f_op, filp->private_data are restored */
467 if (file_priv->filp->f_op == &exynos_drm_gem_fops) { 467 if (file_priv->filp->f_op == &exynos_drm_gem_fops) {
468 file_priv->filp->f_op = fops_get(dev->driver->fops); 468 file_priv->filp->f_op = fops_get(dev->driver->fops);
469 file_priv->filp->private_data = file_priv; 469 file_priv->filp->private_data = file_priv;
470 } 470 }
471 mutex_unlock(&dev->struct_mutex); 471 mutex_unlock(&dev->struct_mutex);
472 return PTR_ERR((void *)addr); 472 return (int)addr;
473 } 473 }
474 474
475 mutex_unlock(&dev->struct_mutex); 475 mutex_unlock(&dev->struct_mutex);