svn commit: r233745 - head/sys/netinet/ipfw
Julian Elischer
julian at freebsd.org
Tue Apr 3 23:46:26 UTC 2012
On 3/31/12 4:20 AM, Gleb Smirnoff wrote:
Many years ago there was the possibility that malloc M_WAITOK could
return on shutdown or in some other rare error cases.
Are we certain this is no longer true?
> Author: glebius
> Date: Sat Mar 31 11:20:48 2012
> New Revision: 233745
> URL: http://svn.freebsd.org/changeset/base/233745
>
> Log:
> Don't check malloc(M_WAITOK) results.
>
> Modified:
> head/sys/netinet/ipfw/ip_fw_sockopt.c
>
> Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c
> ==============================================================================
> --- head/sys/netinet/ipfw/ip_fw_sockopt.c Sat Mar 31 10:47:40 2012 (r233744)
> +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Sat Mar 31 11:20:48 2012 (r233745)
> @@ -163,8 +163,6 @@ ipfw_add_rule(struct ip_fw_chain *chain,
>
> l = RULESIZE(input_rule);
> rule = malloc(l, M_IPFW, M_WAITOK | M_ZERO);
> - if (rule == NULL)
> - return (ENOSPC);
> /* get_map returns with IPFW_UH_WLOCK if successful */
> map = get_map(chain, 1, 0 /* not locked */);
> if (map == NULL) {
> @@ -1010,8 +1008,6 @@ ipfw_ctl(struct sockopt *sopt)
> if (size>= sopt->sopt_valsize)
> break;
> buf = malloc(size, M_TEMP, M_WAITOK);
> - if (buf == NULL)
> - break;
> IPFW_UH_RLOCK(chain);
> /* check again how much space we need */
> want = chain->static_len + ipfw_dyn_len();
>
>
More information about the svn-src-head
mailing list