DragonFly BSD
DragonFly users List (threaded) for 2005-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: em driver issues


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Fri, 4 Feb 2005 02:16:26 +0100
Mail-followup-to: users@crater.dragonflybsd.org

On Thu, Feb 03, 2005 at 08:04:27PM -0500, EM1897@xxxxxxx wrote:
> m_clalloc()

                mcl = malloc(sizeof(*mcl), M_MBUFCL, M_NOWAIT|M_NULLOK|M_ZERO);
                if (mcl == NULL && how == MB_WAIT) {
                        mbstat.m_wait++;
                        mcl = malloc(sizeof(*mcl),
                                        M_MBUFCL, M_WAITOK|M_NULLOK|M_ZERO);
                }
. ..
                if (data == NULL) {
                        free(mcl, M_MBUFCL);
                        break;
                }  

This is the culprot. We have to check for mcl == NULL before the free
as the bare minum. Matt, shouldn't we either block or return if the
allocation for mcl fails?

Joerg



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]