From 6d65e5eee6fc8fa9abef9e78e7e789c2cb06f95c Mon Sep 17 00:00:00 2001 From: Michio Honda Date: Fri, 10 Jun 2011 16:42:14 +0900 Subject: [PATCH] sctp: kzalloc() error handling on deleting last address Signed-off-by: Michio Honda Acked-by: Wei Yongjun Signed-off-by: David S. Miller --- net/sctp/socket.c | 4 ++++ 1 file changed, 4 insertions(+) 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 = -- 2.20.1