From 7778288678b4fb0f9e88c67cd176f77953a7bd30 Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 13 Apr 2006 01:11:08 +0000 Subject: [PATCH] Coverity CID 762: Protect against NULL dereferencing entry->object.uvm_obj like we do a few lines before. Maybe all the tests should be changed to UVM_ET_ISOBJ(), or the macro should do it internally? --- sys/uvm/uvm_map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index cee81810a8e5..da45e5baa58f 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_map.c,v 1.216 2006/03/15 18:09:25 drochner Exp $ */ +/* $NetBSD: uvm_map.c,v 1.217 2006/04/13 01:11:08 christos Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.216 2006/03/15 18:09:25 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.217 2006/04/13 01:11:08 christos Exp $"); #include "opt_ddb.h" #include "opt_uvmhist.h" @@ -681,7 +681,7 @@ uvm_map_clip_start(struct vm_map *map, struct vm_map_entry *entry, /* ... unlikely to happen, but play it safe */ uvm_map_reference(new_entry->object.sub_map); } else { - if (UVM_ET_ISOBJ(entry) && + if (UVM_ET_ISOBJ(entry) && entry->object.uvm_obj && entry->object.uvm_obj->pgops && entry->object.uvm_obj->pgops->pgo_reference) entry->object.uvm_obj->pgops->pgo_reference(