diff options
-rw-r--r-- | net/ipv4/igmp.c | 2 | ||||
-rw-r--r-- | net/ipv6/mcast.c | 2 |
2 files changed, 4 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++; |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 882cde4b4047..e3ec21695832 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -1582,6 +1582,8 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc, | |||
1582 | skb = add_grhead(skb, pmc, type, &pgr); | 1582 | skb = add_grhead(skb, pmc, type, &pgr); |
1583 | first = 0; | 1583 | first = 0; |
1584 | } | 1584 | } |
1585 | if (!skb) | ||
1586 | return NULL; | ||
1585 | psrc = (struct in6_addr *)skb_put(skb, sizeof(*psrc)); | 1587 | psrc = (struct in6_addr *)skb_put(skb, sizeof(*psrc)); |
1586 | *psrc = psf->sf_addr; | 1588 | *psrc = psf->sf_addr; |
1587 | scount++; stotal++; | 1589 | scount++; stotal++; |