[PATCH 10/13] nfsd: store export path in export

J. Bruce Fields bfields at fieldses.org
Wed Sep 6 15:27:06 EDT 2006


On Mon, Sep 04, 2006 at 05:34:55PM +1000, Neil Brown wrote:
> On Friday September 1, bfields at fieldses.org wrote:
> > @@ -428,6 +429,9 @@ static int svc_export_parse(struct cache
> >  	exp.ex_client = dom;
> >  	exp.ex_mnt = nd.mnt;
> >  	exp.ex_dentry = nd.dentry;
> > +	exp.ex_path = kstrdup(buf, GFP_KERNEL);
> > +	if (!exp.ex_path)
> > +		goto out;
> 
> 'err' is 0 at this point.  Need to be set to -ENOMEM before the 'if'.

Yep.

> Fixed.
> 
> >  
> >  	/* expiry */
> >  	err = -EINVAL;
> > @@ -473,6 +477,7 @@ static int svc_export_parse(struct cache
> >  	else
> >  		exp_put(expp);
> >   out:
> > + 	kfree(exp.ex_path);
> 
> exp.ex_path might be uninitialised at this point.
> Fixed.

Yep, thanks!

--b.


More information about the NFSv4 mailing list