tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: patch: debug instrumentation for dev/raidframe/rf_netbsdkintf.c



On Tue, Jan 22, 2019 at 08:32:48AM +1100, matthew green wrote:
> > > @@ -472,6 +472,9 @@
> > >  	const char *bootname = device_xname(bdv);
> > >  	size_t len = strlen(bootname);
> > >  
> > > +	if (bdv == NULL)
> > > +		return 0;
> > > +
> > 
> > This looked suspicious, even before I read the code.
> > 
> > The question is if it is ever legitimate for bdv to be NULL.
> 
> infact, bdv has already been dereferenced at this point:
> the assignment to bootname 3 lines up.

Argh.  That's what I get for first removing the code I added which
correctly moved the initialization of bootname and len to after the
bdv==NULL check and the re-adding it at midnight.

--chris


Home | Main Index | Thread Index | Old Index