summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2010-04-16 16:27:13 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2010-04-16 16:27:13 +0000
commita0196aea407b6554fb24d172182d8d2f91605485 (patch)
tree929fd2d1e533034bbb82dbc60aacafe9125de58f /sys
parent56298d6a3015debdb37655367774bafa2e2519ac (diff)
paranoia: NULL check before free.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/i915_drv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c
index fefd718aeb6..3b5454141c5 100644
--- a/sys/dev/pci/drm/i915_drv.c
+++ b/sys/dev/pci/drm/i915_drv.c
@@ -4133,7 +4133,8 @@ inteldrm_teardown_mchbar(struct drm_i915_private *dev_priv,
high = pci_conf_read(bpa->pa_pc, bpa->pa_tag, reg + 4);
low = pci_conf_read(bpa->pa_pc, bpa->pa_tag, reg);
mchbar_addr = ((u_int64_t)high << 32) | low;
- extent_free(bpa->pa_memex, mchbar_addr, MCHBAR_SIZE, 0);
+ if (bpa->pa_memex)
+ extent_free(bpa->pa_memex, mchbar_addr, MCHBAR_SIZE, 0);
/* FALLTHROUGH */
case 1:
if (IS_I915G(dev_priv) || IS_I915GM(dev_priv)) {