diff options
author | Alexey Dobriyan <adobriyan@openvz.org> | 2007-02-06 17:35:25 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-02-08 15:39:04 -0500 |
commit | cc63f70b8b410eb653449151821f6b8b9af6ca42 (patch) | |
tree | b78fb82523f1ed05c6e0a3547021ba213aa2d3b6 /net/ipv4/igmp.c | |
parent | f2f2102d1a1dbc83b5b37b6596cd8374120cbe16 (diff) |
[IPV4/IPV6] multicast: Check add_grhead() return value
add_grhead() allocates memory with GFP_ATOMIC and in at least two places skb
from it passed to skb_put() without checking.
Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r-- | net/ipv4/igmp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 0017ccb01d6d..024ae56cab25 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -455,6 +455,8 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc, | |||
455 | skb = add_grhead(skb, pmc, type, &pgr); | 455 | skb = add_grhead(skb, pmc, type, &pgr); |
456 | first = 0; | 456 | first = 0; |
457 | } | 457 | } |
458 | if (!skb) | ||
459 | return NULL; | ||
458 | psrc = (__be32 *)skb_put(skb, sizeof(__be32)); | 460 | psrc = (__be32 *)skb_put(skb, sizeof(__be32)); |
459 | *psrc = psf->sf_inaddr; | 461 | *psrc = psf->sf_inaddr; |
460 | scount++; stotal++; | 462 | scount++; stotal++; |