diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2001-12-30 17:34:19 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2001-12-30 17:34:19 +0000 |
| commit | e3f4d3b5e816459d58a4c5e82d008d1365b00316 (patch) | |
| tree | ffd0f51887d8d89e463b5c296c95ad91fc1b9b20 /sys/dev | |
| parent | dd966920a7a1050cc4d6cebe8a344367948cabc3 (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ccd/ccd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c index dc9ea96d0491..fcf968e06a67 100644 --- a/sys/dev/ccd/ccd.c +++ b/sys/dev/ccd/ccd.c @@ -394,7 +394,7 @@ ccdinit(struct ccd_s *cs, char **cpaths, struct thread *td) int maxsecsize; struct partinfo dpart; struct ccdgeom *ccg = &cs->sc_geom; - char tmppath[MAXPATHLEN]; + char *tmppath = NULL; int error = 0; #ifdef DEBUG @@ -414,6 +414,7 @@ ccdinit(struct ccd_s *cs, char **cpaths, struct thread *td) */ maxsecsize = 0; minsize = 0; + tmppath = malloc(MAXPATHLEN, M_DEVBUF, M_WAITOK); for (ix = 0; ix < cs->sc_nccdisks; ix++) { vp = cs->sc_vpp[ix]; ci = &cs->sc_cinfo[ix]; @@ -422,7 +423,6 @@ ccdinit(struct ccd_s *cs, char **cpaths, struct thread *td) /* * Copy in the pathname of the component. */ - bzero(tmppath, sizeof(tmppath)); /* sanity */ if ((error = copyinstr(cpaths[ix], tmppath, MAXPATHLEN, &ci->ci_pathlen)) != 0) { #ifdef DEBUG @@ -488,6 +488,9 @@ ccdinit(struct ccd_s *cs, char **cpaths, struct thread *td) cs->sc_size += size; } + free(tmppath, M_DEVBUF); + tmppath = NULL; + /* * Don't allow the interleave to be smaller than * the biggest component sector. @@ -577,6 +580,8 @@ fail: ci--; free(ci->ci_path, M_DEVBUF); } + if (tmppath != NULL) + free(tmppath, M_DEVBUF); free(cs->sc_cinfo, M_DEVBUF); return (error); } |
