From 0c5f7aaab5e12759f613184830277703a1d7a5ab Mon Sep 17 00:00:00 2001 From: Alfred Perlstein Date: Fri, 14 Feb 2003 13:18:51 +0000 Subject: [PATCH] Add kasserts to catch bad API usage. Submitted by: Hiten Pandya --- sys/kern/vfs_mount.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 52937c923931..190480095d4a 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1714,6 +1714,9 @@ vfs_getopt(opts, name, buf, len) { struct vfsopt *opt; + KASSERT(opts != NULL, + ("vfs_getopt: caller passed 'opts' as NULL\n")); + TAILQ_FOREACH(opt, opts, link) { if (strcmp(name, opt->name) == 0) { if (len != NULL) @@ -1743,6 +1746,9 @@ vfs_copyopt(opts, name, dest, len) { struct vfsopt *opt; + KASSERT(opts != NULL, + ("vfs_copyopt: caller passed 'opts' as NULL\n")); + TAILQ_FOREACH(opt, opts, link) { if (strcmp(name, opt->name) == 0) { if (len != opt->len)