uma_zfree(NULL) is broken

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: mdf
Date: Monday, October 18, 2010 - 1:59 pm

There's explicit protection for free(NULL, M_FOO), but uma_zfree(zone,
NULL) will put NULL in the local bucket and then probably return it
later from a uma_zalloc call.  Obviously it's not a good idea to call
uma_zfree(9) on NULL, but in this case it's an easy mistake to make
when e.g. converting a set of malloc(9)/free(9) uses into uma(9).

So is the "right" thing to allow a uma_zfree(NULL) and silently
succeed, like for free(9)?  That would be my guess, but I'm open to
alternatives.

Thanks,
matthew
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
uma_zfree(NULL) is broken, mdf, (Mon Oct 18, 1:59 pm)
Re: uma_zfree(NULL) is broken, John Baldwin, (Tue Oct 19, 5:55 am)