Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Sep 2012 09:19:12 -0700
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        svn-src-head@freebsd.org, Alexey Dokuchaev <danfe@freebsd.org>, src-committers@freebsd.org, Edward Tomasz Napierala <trasz@freebsd.org>, svn-src-all@freebsd.org
Subject:   Re: svn commit: r240993 - head/sys/cam/ctl
Message-ID:  <CAGH67wSAs16ijhbYdQPk=MPbwsT60dh_yM_zodUGnEyJ%2BH8pXA@mail.gmail.com>
In-Reply-To: <CAJ-VmomOExtXZ0sZEzpZSbJAZdse4L2zXj3tNXFO3fhD0KrWvQ@mail.gmail.com>
References:  <201209271051.q8RApcmq002950@svn.freebsd.org> <20120927131810.GA54552@FreeBSD.org> <CAJ-VmomOExtXZ0sZEzpZSbJAZdse4L2zXj3tNXFO3fhD0KrWvQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 27, 2012 at 8:50 AM, Adrian Chadd <adrian@freebsd.org> wrote:
> .. I thought that malloc(.. , M_WAITOK) can return NULL. Wasn't there
> a discussion about this on IRC?

Shouldn't -- else it would break the API contract:

     M_WAITOK
             Indicates that it is OK to wait for resources.  If the request
             cannot be immediately fulfilled, the current process is put to
             sleep to wait for resources to be released by other processes.
             The malloc(), realloc(), and reallocf() functions cannot return
             NULL if M_WAITOK is specified.

There was some discussion a little while ago IIRC about there being a
bug where it could return NULL, but that bug should really be quashed,
not disguised.

Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGH67wSAs16ijhbYdQPk=MPbwsT60dh_yM_zodUGnEyJ%2BH8pXA>