summaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorMichio Honda <micchie@sfc.wide.ad.jp>2011-06-10 09:42:14 +0200
committerDavid S. Miller <davem@davemloft.net>2011-06-12 00:53:45 +0200
commit6d65e5eee6fc8fa9abef9e78e7e789c2cb06f95c (patch)
tree5f01ae4b2f28dd5e462fb73770edfe61de39487c /net/sctp
parentnet: add Faraday FTGMAC100 Gigabit Ethernet driver (diff)
downloadlinux-6d65e5eee6fc8fa9abef9e78e7e789c2cb06f95c.tar.xz
linux-6d65e5eee6fc8fa9abef9e78e7e789c2cb06f95c.zip
sctp: kzalloc() error handling on deleting last address
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>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index e7e1b142875c..60038fef3ba1 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -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 =