Subject: Re: kpsignal2 panic
To: Matt Thomas <matt@3am-software.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 10/06/2003 15:16:20
--IMjqdzrDRly81ofr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Oct 03, 2003 at 03:49:05PM -0700, Matt Thomas wrote:
> At 03:42 PM 10/3/2003, Andrey Petrov wrote:
> >And it did fixes the problem. Here's another patch for review.

> >+
> >+               if (fdp =3D=3D NULL) {
> >+ #ifdef DIAGNOSTIC
> >+                       printf("kpsignal1: fdp NULL, proc %d flags %x\n",
> >+                              p->p_pid, p->p_flag);
> >+ #endif
> >+                       return;
> >+               }
> >+
> >                for (fd =3D 0; fd < fdp->fd_nfiles; fd++) {
> >                        struct file *fp =3D fdp->fd_ofiles[fd];
> >                        /* XXX: lock? */
>=20
>=20
> Looks good to me.  (but you might to move the entire if inside the #ifdef=
).

I'd say leave it as-is. Even though we _shouldn't_ see NULL, checking it=20
is cheep before deref, and seems safer.

Take care,

Bill

--IMjqdzrDRly81ofr
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQE/gem0Wz+3JHUci9cRAinTAJ9TvrRraNcFKRKKljRIdMN84uBssQCffKoI
Y2Zd28VkaMwgqSK95hHSDvY=
=EuKK
-----END PGP SIGNATURE-----

--IMjqdzrDRly81ofr--