Commit 2ef502b3 authored by NeilBrown's avatar NeilBrown Committed by Chris Wright

[PATCH] knfsd: Avoid use of unitialised variables on error path when nfs exports.

We need to zero various parts of 'exp' before any 'goto out', otherwise
when we go to free the contents... we die.
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
parent 7e57df06
......@@ -469,6 +469,13 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
nd.dentry = NULL;
exp.ex_path = NULL;
/* fs locations */
exp.ex_fslocs.locations = NULL;
exp.ex_fslocs.locations_count = 0;
exp.ex_fslocs.migrated = 0;
exp.ex_uuid = NULL;
if (mesg[mlen-1] != '\n')
return -EINVAL;
mesg[mlen-1] = 0;
......@@ -509,13 +516,6 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
if (exp.h.expiry_time == 0)
goto out;
/* fs locations */
exp.ex_fslocs.locations = NULL;
exp.ex_fslocs.locations_count = 0;
exp.ex_fslocs.migrated = 0;
exp.ex_uuid = NULL;
/* flags */
err = get_int(&mesg, &an_int);
if (err == -ENOENT)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment