sctp: kzalloc() error handling on deleting last address
authorMichio Honda <micchie@sfc.wide.ad.jp>
Fri, 10 Jun 2011 07:42:14 +0000 (16:42 +0900)
committerDavid S. Miller <davem@davemloft.net>
Sat, 11 Jun 2011 22:53:45 +0000 (15:53 -0700)
Signed-off-by: Michio Honda <micchie@sfc.wide.ad.jp>
Acked-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/socket.c

index e7e1b142875c7ca8f3c501ed7510ca2fc534dd2d..60038fef3ba14e982ea5317b9f30b41697bc20fc 100644 (file)
@@ -786,6 +786,10 @@ static int sctp_send_asconf_del_ip(struct sock             *sk,
                                continue;
                        asoc->asconf_addr_del_pending =
                            kzalloc(sizeof(union sctp_addr), GFP_ATOMIC);
+                       if (asoc->asconf_addr_del_pending == NULL) {
+                               retval = -ENOMEM;
+                               goto out;
+                       }
                        asoc->asconf_addr_del_pending->sa.sa_family =
                                    addrs->sa_family;
                        asoc->asconf_addr_del_pending->v4.sin_port =