Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Sep 2003 10:46:56 -0500
From:      Bob Willcox <bob@immure.com>
To:        hackers list <freebsd-hackers@freebsd.org>
Subject:   getblk() may return NULL, but most caller's don't check for it
Message-ID:  <20030904154656.GA77746@luke.immure.com>

next in thread | raw e-mail | index | archive | help
Hi All,

While perusing the FreeBSD kernel source code today I noticed that
there are several reasons that the getblk() function in vfs_bio.c might
decide to return a NULL return code. However, checking both 4-stable and
5-current I can find only place (in 5-curren) where the return value
from getblk() is actually checked for the possibility of being NULL (in
function cluster_rbuild() in vfs_cluster.c near line 389). In all other
instances that I can find the returned value is quickly dereferenced w/o
any check.

What am I missing here? Is this really a bug, or are there extenuating
circumstances that prevent getblk() from returning NULL in actual
operation?

Thanks for any insight that you may provide.
Bob

-- 
Bob Willcox                  Maslow's Maxim:
bob@immure.com                   If the only tool you have is a hammer,
Austin, TX                       you treat everything like a nail.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030904154656.GA77746>