summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2008-09-01 17:50:16 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2008-09-01 17:50:16 +0000
commita599c8d122cabfcd439ac6424a67f197c8178e7e (patch)
tree68b3f43d591434a782564a400afe541a97db1ef7 /sys/dev/pci/drm
parent48292a0394a03d736e1630c4e7eadf056fbfee42 (diff)
fix null dereference.
initial patch from me, reworked by oga@. found by LLVM/Clang Static Analyzer. ok oga@
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/drm_memory.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_memory.c b/sys/dev/pci/drm/drm_memory.c
index 81dc4a10e98..a1eba523d7b 100644
--- a/sys/dev/pci/drm/drm_memory.c
+++ b/sys/dev/pci/drm/drm_memory.c
@@ -136,7 +136,10 @@ done:
void
drm_ioremapfree(drm_local_map_t *map)
{
- if (map != NULL && map->bsr != NULL)
+ if (map == NULL)
+ return;
+
+ if (map->bsr != NULL)
vga_pci_bar_unmap(map->bsr);
else
bus_space_unmap(map->bst, map->bsh, map->size);