From 89c914608921cd9f7b67990634e1826074aae704 Mon Sep 17 00:00:00 2001 From: chl Date: Mon, 1 Sep 2008 17:50:15 +0000 Subject: [PATCH] fix null dereference. initial patch from me, reworked by oga@. found by LLVM/Clang Static Analyzer. ok oga@ --- sys/dev/pci/drm/drm_memory.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.20.1