From 0a7d87f083982e2a640fdde706de3e98ed8b7b31 Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 18 Mar 2006 21:05:10 +0000 Subject: [PATCH] Coverity CID 957: Prevent NULL pointer deref. --- dist/am-utils/amd/amfs_generic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/am-utils/amd/amfs_generic.c b/dist/am-utils/amd/amfs_generic.c index ff284bc6cc91..a0937a4bf774 100644 --- a/dist/am-utils/amd/amfs_generic.c +++ b/dist/am-utils/amd/amfs_generic.c @@ -1,4 +1,4 @@ -/* $NetBSD: amfs_generic.c,v 1.3 2006/03/18 20:48:42 christos Exp $ */ +/* $NetBSD: amfs_generic.c,v 1.4 2006/03/18 21:05:10 christos Exp $ */ /* * Copyright (c) 1997-2005 Erez Zadok @@ -771,7 +771,7 @@ amfs_bgmount(struct continuation *cp) goto already_mounted; } - if (mf->mf_fo->fs_mtab) { + if (mf->mf_fo && mf->mf_fo->fs_mtab) { plog(XLOG_MAP, "Trying mount of %s on %s fstype %s mount_type %s", mf->mf_fo->fs_mtab, mf->mf_mount, p->fs_type, mp->am_flags & AMF_AUTOFS ? "autofs" : "non-autofs"); @@ -785,7 +785,7 @@ amfs_bgmount(struct continuation *cp) if (this_error < 0) goto retry; - if (mf->mf_fo->opt_delay) { + if (mf->mf_fo && mf->mf_fo->opt_delay) { /* * If there is a delay timer on the mount * then don't try to mount if the timer