Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jun 2004 00:17:27 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Lukas Ertl <le@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/geom/vinum geom_vinum_raid5.c
Message-ID:  <20040622221727.GV12007@darkness.comp.waw.pl>
In-Reply-To: <200406221454.i5MEsVrp091154@repoman.freebsd.org>
References:  <200406221454.i5MEsVrp091154@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Tue, Jun 22, 2004 at 02:54:31PM +0000, Lukas Ertl wrote:
+> le          2004-06-22 14:54:31 UTC
+> 
+>   FreeBSD src repository
+> 
+>   Modified files:
+>     sys/geom/vinum       geom_vinum_raid5.c 
+>   Log:
+>   Don't sleep in the g_down path.  More error checks to come.

Yeah, there are many potential memory leaks, many situations like this:

	ptr = malloc(...);
	if (ptr == NULL)
		return (ENOMEM);
	LIST_FOREACH(...) {
		ptr1 = malloc(...);
		if (ptr1 == NULL)
			return (ENOMEM);
		[...]
		ptr2 = malloc(...);
		if (ptr2 == NULL)
			return (ENOMEM);
	}

So if for example allocation of 'ptr2' fails, we leak 'ptr' and 'ptr1'.
Maybe you should just use kernel thread to do whole I/O handling to
avoid such complex scenarious?

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd@FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFA2K/3ForvXbEpPzQRAg1sAJ4hI01c5htGb/K6ool2IjjM2GPqjwCfaiui
RnZLg5AqRAVOSyFd5k5WMxg=
=Lgxl
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040622221727.GV12007>