Add kasserts to catch bad API usage.
Submitted by: Hiten Pandya <hiten@unixdaemons.com>
This commit is contained in:
parent
c11110eabe
commit
0c5f7aaab5
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user