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
--wFcEkHhPyqONlKAq
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Tue, Jun 22, 2004 at 02:54:31PM +0000, Lukas Ertl wrote:
+> le 2004-06-22 14:54:31 UTC
+>=20
+> FreeBSD src repository
+>=20
+> Modified files:
+> sys/geom/vinum geom_vinum_raid5.c=20
+> 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 =3D malloc(...);
if (ptr =3D=3D NULL)
return (ENOMEM);
LIST_FOREACH(...) {
ptr1 =3D malloc(...);
if (ptr1 =3D=3D NULL)
return (ENOMEM);
[...]
ptr2 =3D malloc(...);
if (ptr2 =3D=3D 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?
--=20
Pawel Jakub Dawidek http://www.FreeBSD.org
pjd@FreeBSD.org http://garage.freebsd.pl
FreeBSD committer Am I Evil? Yes, I Am!
--wFcEkHhPyqONlKAq
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)
iD8DBQFA2K/3ForvXbEpPzQRAg1sAJ4hI01c5htGb/K6ool2IjjM2GPqjwCfaiui
RnZLg5AqRAVOSyFd5k5WMxg=
=Lgxl
-----END PGP SIGNATURE-----
--wFcEkHhPyqONlKAq--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040622221727.GV12007>
