Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/riastradh-drm2]: src/sys/external/bsd/drm2/dist/drm Avoid arithmetic on ...



details:   https://anonhg.NetBSD.org/src/rev/309db4fa9478
branches:  riastradh-drm2
changeset: 788104:309db4fa9478
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 24 02:15:30 2013 +0000

description:
Avoid arithmetic on void * in drm_crtc.c.

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_crtc.c |  18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diffs (48 lines):

diff -r 43848c0917ed -r 309db4fa9478 sys/external/bsd/drm2/dist/drm/drm_crtc.c
--- a/sys/external/bsd/drm2/dist/drm/drm_crtc.c Wed Jul 24 02:15:14 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_crtc.c Wed Jul 24 02:15:30 2013 +0000
@@ -3529,13 +3529,21 @@
                goto out;
        }
 
+#ifdef __NetBSD__
+       g_base = (char *)r_base + size;
+#else
        g_base = r_base + size;
+#endif
        if (copy_from_user(g_base, (void __user *)(unsigned long)crtc_lut->green, size)) {
                ret = -EFAULT;
                goto out;
        }
 
+#ifdef __NetBSD__
+       b_base = (char *)g_base + size;
+#else
        b_base = g_base + size;
+#endif
        if (copy_from_user(b_base, (void __user *)(unsigned long)crtc_lut->blue, size)) {
                ret = -EFAULT;
                goto out;
@@ -3583,13 +3591,21 @@
                goto out;
        }
 
-       g_base = r_base + size;
+#ifdef __NetBSD__
+       g_base = (char *)r_base + size;
+#else
+       g_base = (char *)r_base + size;
+#endif
        if (copy_to_user((void __user *)(unsigned long)crtc_lut->green, g_base, size)) {
                ret = -EFAULT;
                goto out;
        }
 
+#ifdef __NetBSD__
+       b_base = (char *)g_base + size;
+#else
        b_base = g_base + size;
+#endif
        if (copy_to_user((void __user *)(unsigned long)crtc_lut->blue, b_base, size)) {
                ret = -EFAULT;
                goto out;



Home | Main Index | Thread Index | Old Index