diff options
author | pjd <pjd@FreeBSD.org> | 2005-01-22 19:56:03 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2005-01-22 19:56:03 +0000 |
commit | 5b525d8ac1f788291e823fd5ae3ab3736771be73 (patch) | |
tree | 995c69cda951e8881e8b5ee1df19dd00cb376a9d /sys | |
parent | 99a68ccb1f502983fd26253292347237e51657c3 (diff) | |
download | FreeBSD-src-5b525d8ac1f788291e823fd5ae3ab3736771be73.zip FreeBSD-src-5b525d8ac1f788291e823fd5ae3ab3736771be73.tar.gz |
- Don't destroy UMA zone on error in mdcreate_malloc(), because we need it
in mddestroy() to properly free already allocated memory.
This fixes a panic when we want to create too big memory backed device
with preallocate memory (-o reserve).
- Remove redundant { }.
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/md/md.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index fdcf4f6..4c5e557 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -819,8 +819,6 @@ mdcreate_malloc(struct md_s *sc, struct md_ioctl *mdio) break; } } - if (error != 0) - uma_zdestroy(sc->uma); return (error); } @@ -945,9 +943,8 @@ mddestroy(struct md_s *sc, struct thread *td) FREAD : (FREAD|FWRITE), sc->cred, td); if (sc->cred != NULL) crfree(sc->cred); - if (sc->object != NULL) { + if (sc->object != NULL) vm_object_deallocate(sc->object); - } if (sc->indir) destroy_indir(sc, sc->indir); if (sc->uma) |