From 2ce6f7c5c64161877cda013010f0de015e39a489 Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 15 Apr 2006 03:59:23 +0000 Subject: [PATCH] Coverity CID 1093: Fix NULL deref. --- sys/fs/smbfs/smbfs_vnops.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c index 19310d51a6cc..433f2038d610 100644 --- a/sys/fs/smbfs/smbfs_vnops.c +++ b/sys/fs/smbfs/smbfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: smbfs_vnops.c,v 1.50 2006/04/15 02:55:06 christos Exp $ */ +/* $NetBSD: smbfs_vnops.c,v 1.51 2006/04/15 03:59:23 christos Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: smbfs_vnops.c,v 1.50 2006/04/15 02:55:06 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smbfs_vnops.c,v 1.51 2006/04/15 03:59:23 christos Exp $"); #include #include @@ -952,7 +952,6 @@ smbfs_strategy(v) } */ *ap = v; struct buf *bp = ap->a_bp; struct ucred *cr; - struct proc *p; struct lwp *l; int error = 0; @@ -961,13 +960,12 @@ smbfs_strategy(v) panic("smbfs physio/async"); if (bp->b_flags & B_ASYNC) { l = NULL; - p = NULL; + cr = NULL; } else { l = curlwp; /* XXX */ - p = l->l_proc; + cr = l->l_proc->p_ucred; } - cr = p->p_ucred; /* XXX */ if ((bp->b_flags & B_ASYNC) == 0) error = smbfs_doio(bp, cr, l);