Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Oct 2002 15:56:57 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        tlambert2@mindspring.com
Cc:        jake@locore.ca, ben@stuyts.nl, current@FreeBSD.ORG, jroberson@chesapeake.net, rwatson@FreeBSD.ORG, jeff@FreeBSD.ORG, alfred@FreeBSD.ORG
Subject:   Re: [Ugly PATCH] Again: panic kmem_malloc()
Message-ID:  <20021020.155657.10475080.imp@bsdimp.com>
In-Reply-To: <3DB31925.7B70E70@mindspring.com>
References:  <20021018213608.A60569@locore.ca> <20021020.125308.35255652.imp@bsdimp.com> <3DB31925.7B70E70@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <3DB31925.7B70E70@mindspring.com>
            Terry Lambert <tlambert2@mindspring.com> writes:
: "M. Warner Losh" wrote:
: > : +     if (sops)
: > : +             free(sops, M_SEM);
: > 
: > The kernel free() groks free(NULL, M_FOO), so the if isn't needed.
: 
: Wow.  That's bogus.  It should panic.

It isn't bogus.  free(NULL) is defined to be OK in ansi-c.  The kernel
just mirrors that.

: Or we should fix all of libc to take NULL arguments for strings,
: and treat them as if they were actually "".

That's bogus.

Warner

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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