net/igmp: add sanity check to handle allocate fail
Change-Id: Ia3128c9c2b219345fb6ac2789ece7760c6aee663 Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
316cdccf82
commit
ab78bae12f
@ -135,6 +135,11 @@ int igmp_joingroup(struct net_driver_s *dev,
|
||||
|
||||
ninfo("Join to new group: %08" PRIx32 "\n", (uint32_t)grpaddr->s_addr);
|
||||
group = igmp_grpalloc(dev, &grpaddr->s_addr);
|
||||
if (group == NULL)
|
||||
{
|
||||
return -EADDRNOTAVAIL;
|
||||
}
|
||||
|
||||
IGMP_STATINCR(g_netstats.igmp.joins);
|
||||
|
||||
/* Send the Membership Report */
|
||||
|
Loading…
Reference in New Issue
Block a user