cvs commit: src/sys/dev/pccard/pccbb pccbb.c

Joerg Sonnenberger joerg at britannica.bec.de
Fri Aug 12 09:00:03 PDT 2005


On Thu, Aug 11, 2005 at 08:23:30PM +0200, Simon 'corecode' Schubert wrote:
> On 11.08.2005, at 19:33, Matthew Dillon wrote:
> >    Same here.  In this case the malloc clearly should not be
> >    allowed to fail as this code is called as part of the 
> >initialization
> >    phase.  This is a common occurance in FreeBSD code and we've been
> >    changing those M_NOWAIT's to M_INTWAIT's right and left for
> >    initialization phase code.
> 
> But it can fail, like other things in the initialization can fail as 
> well.  All other code copes with failures, except cbb_insert_res.

This code must not fail if possible. One reason is that the callers
might indead be allowed to block and therefore use M_WAITOK, but we
can't do that here. M_INTWAIT dramatically increases the chance of
success and allocating from the interrupt reserve is definitely wanted
here.

Joerg





More information about the Commits mailing list