Add kasserts to catch bad API usage.

Submitted by: Hiten Pandya <hiten@unixdaemons.com>
This commit is contained in:
Alfred Perlstein 2003-02-14 13:18:51 +00:00
parent c11110eabe
commit 0c5f7aaab5

View File

@ -1714,6 +1714,9 @@ vfs_getopt(opts, name, buf, len)
{ {
struct vfsopt *opt; struct vfsopt *opt;
KASSERT(opts != NULL,
("vfs_getopt: caller passed 'opts' as NULL\n"));
TAILQ_FOREACH(opt, opts, link) { TAILQ_FOREACH(opt, opts, link) {
if (strcmp(name, opt->name) == 0) { if (strcmp(name, opt->name) == 0) {
if (len != NULL) if (len != NULL)
@ -1743,6 +1746,9 @@ vfs_copyopt(opts, name, dest, len)
{ {
struct vfsopt *opt; struct vfsopt *opt;
KASSERT(opts != NULL,
("vfs_copyopt: caller passed 'opts' as NULL\n"));
TAILQ_FOREACH(opt, opts, link) { TAILQ_FOREACH(opt, opts, link) {
if (strcmp(name, opt->name) == 0) { if (strcmp(name, opt->name) == 0) {
if (len != opt->len) if (len != opt->len)