Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/radeon Restore previous KASSERT but wi...



details:   https://anonhg.NetBSD.org/src/rev/5577baa15c1f
branches:  trunk
changeset: 841784:5577baa15c1f
user:      maya <maya%NetBSD.org@localhost>
date:      Fri May 31 03:41:32 2019 +0000

description:
Restore previous KASSERT but with the same condition as in nouveaufb.c,
which is the code I was trying to mimic.

Thanks riastradh for the heads up and fix.

diffstat:

 sys/external/bsd/drm2/radeon/radeondrmkmsfb.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r c8512806db78 -r 5577baa15c1f sys/external/bsd/drm2/radeon/radeondrmkmsfb.c
--- a/sys/external/bsd/drm2/radeon/radeondrmkmsfb.c     Fri May 31 03:28:48 2019 +0000
+++ b/sys/external/bsd/drm2/radeon/radeondrmkmsfb.c     Fri May 31 03:41:32 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeondrmkmsfb.c,v 1.11 2019/05/31 03:28:48 maya Exp $ */
+/*     $NetBSD: radeondrmkmsfb.c,v 1.12 2019/05/31 03:41:32 maya Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeondrmkmsfb.c,v 1.11 2019/05/31 03:28:48 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeondrmkmsfb.c,v 1.12 2019/05/31 03:41:32 maya Exp $");
 
 #include <sys/types.h>
 #include <sys/device.h>
@@ -192,6 +192,9 @@
        if (offset < 0)
                return -1;
 
+       const unsigned num_pages __diagused = rbo->tbo.num_pages;
+
+       KASSERT(offset < (num_pages << PAGE_SHIFT));
        KASSERT(rbo->tbo.mem.bus.is_iomem);
 
        if (ISSET(rbo->tbo.mem.placement, TTM_PL_FLAG_WC))



Home | Main Index | Thread Index | Old Index