summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2010-04-28 00:40:23 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2010-04-28 00:40:23 +0000
commit674a42e208f0a7a01da7e3b2c128e6cb47c6a61d (patch)
tree4cb928055f0893e8ff4bf4103f1c22aacd36a1a8 /sys/dev
parentf70baac7b476ea686483e57a524d3ab29e60e752 (diff)
Deal with a non-incremented iterator by changing a
while (condition) { do_stuff() increment_condition /* this was missing */ } To a for loop like it always should have been. I have no idea what I was smoking when I wrote this function. Fixes the crash on hardware that does bit 17 swizzling (turns out the three I know of are all 945s) as soon as we first unbind an object. Thank you very much to Brandon Mercer for actually managing to get me a crash dump so i could debug this, and also for testing the fix.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/i915_drv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c
index 7760c2b5ce9..fe8ce3cd507 100644
--- a/sys/dev/pci/drm/i915_drv.c
+++ b/sys/dev/pci/drm/i915_drv.c
@@ -4591,7 +4591,7 @@ i915_gem_save_bit_17_swizzle(struct drm_obj *obj)
segp = &obj_priv->dma_segs[0];
n = 0;
i = 0;
- while (i < page_count) {
+ for (i = 0; i < page_count; i++) {
if ((segp->ds_addr + (n * PAGE_SIZE)) & (1 << 17))
set_bit(i, obj_priv->bit_17);
else