lkml.org 
[lkml]   [2007]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/1] DRM: i915, fix pointer strip
From
Date
i915, fix pointer strip

Beside the emitted warning, the added cast (u64 -> unsigned) strips out
part of address on 64 bit. Cast to unsigned long instead.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Thomas Hellstrom <thomas@tungstengraphics.com>
Cc: Dave Airlie <airlied@linux.ie>

---
commit 496b198ff1b261c902337f93f07e7eabebd15fcd
tree 82e09385c7079b58397c547d4213f8a7f066191e
parent 32df077a4a9ff106df31681999e869971eacb470
author Jiri Slaby <jirislaby@gmail.com> Tue, 13 Nov 2007 14:12:08 +0100
committer Jiri Slaby <jirislaby@gmail.com> Tue, 13 Nov 2007 14:12:08 +0100

drivers/char/drm/i915_dma.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/drm/i915_dma.c b/drivers/char/drm/i915_dma.c
index eced445..a68e0ee 100644
--- a/drivers/char/drm/i915_dma.c
+++ b/drivers/char/drm/i915_dma.c
@@ -900,7 +900,7 @@ int i915_validate_buffer_list(struct drm_file *file_priv,

buffers[buf_count] = NULL;

- if (copy_from_user(&arg, (void __user *)(unsigned)data, sizeof(arg))) {
+ if (copy_from_user(&arg, (void __user *)(unsigned long)data, sizeof(arg))) {
ret = -EFAULT;
goto out_err;
}
@@ -951,7 +951,7 @@ int i915_validate_buffer_list(struct drm_file *file_priv,
arg.handled = 1;
arg.d.rep = rep;

- if (copy_to_user((void __user *)(unsigned)data, &arg, sizeof(arg)))
+ if (copy_to_user((void __user *)(unsigned long)data, &arg, sizeof(arg)))
return -EFAULT;

data = next;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-11-13 14:17    [W:0.172 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site