Coverity CID 1090: Only check suser if we have a process context.

This commit is contained in:
christos 2006-04-09 18:33:43 +00:00
parent 2871f9db99
commit eb8f5ea98d
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: at_control.c,v 1.11 2005/12/11 12:24:54 christos Exp $ */
/* $NetBSD: at_control.c,v 1.12 2006/04/09 18:33:43 christos Exp $ */
/*
* Copyright (c) 1990,1994 Regents of The University of Michigan.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: at_control.c,v 1.11 2005/12/11 12:24:54 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: at_control.c,v 1.12 2006/04/09 18:33:43 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -127,7 +127,7 @@ at_control(cmd, data, ifp, p)
* If we are not superuser, then we don't get to do these
* ops.
*/
if (suser(p->p_ucred, &p->p_acflag))
if (p && suser(p->p_ucred, &p->p_acflag))
return (EPERM);
sat = satosat(&ifr->ifr_addr);