diff options
author | NeilBrown <neilb@suse.de> | 2007-05-09 05:34:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-09 15:30:54 -0400 |
commit | 402acd29e552cb80109d1d5c0ada53f634465d87 (patch) | |
tree | 12c86f3421d3d8679401742e1bc6569c75908ee3 | |
parent | 5bd5f5812bfa753218e02cb773e06ede48055798 (diff) |
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: Neil Brown <neilb@suse.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/nfsd/export.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 6f24768272a1..79bd03b8bbf8 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -469,6 +469,13 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) | |||
469 | nd.dentry = NULL; | 469 | nd.dentry = NULL; |
470 | exp.ex_path = NULL; | 470 | exp.ex_path = NULL; |
471 | 471 | ||
472 | /* fs locations */ | ||
473 | exp.ex_fslocs.locations = NULL; | ||
474 | exp.ex_fslocs.locations_count = 0; | ||
475 | exp.ex_fslocs.migrated = 0; | ||
476 | |||
477 | exp.ex_uuid = NULL; | ||
478 | |||
472 | if (mesg[mlen-1] != '\n') | 479 | if (mesg[mlen-1] != '\n') |
473 | return -EINVAL; | 480 | return -EINVAL; |
474 | mesg[mlen-1] = 0; | 481 | mesg[mlen-1] = 0; |
@@ -509,13 +516,6 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) | |||
509 | if (exp.h.expiry_time == 0) | 516 | if (exp.h.expiry_time == 0) |
510 | goto out; | 517 | goto out; |
511 | 518 | ||
512 | /* fs locations */ | ||
513 | exp.ex_fslocs.locations = NULL; | ||
514 | exp.ex_fslocs.locations_count = 0; | ||
515 | exp.ex_fslocs.migrated = 0; | ||
516 | |||
517 | exp.ex_uuid = NULL; | ||
518 | |||
519 | /* flags */ | 519 | /* flags */ |
520 | err = get_int(&mesg, &an_int); | 520 | err = get_int(&mesg, &an_int); |
521 | if (err == -ENOENT) | 521 | if (err == -ENOENT) |