From 5b525d8ac1f788291e823fd5ae3ab3736771be73 Mon Sep 17 00:00:00 2001 From: pjd Date: Sat, 22 Jan 2005 19:56:03 +0000 Subject: - 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 --- sys/dev/md/md.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sys/dev/md') 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) -- cgit v1.1