From: Michio Honda Date: Fri, 10 Jun 2011 07:42:14 +0000 (+0900) Subject: sctp: kzalloc() error handling on deleting last address X-Git-Tag: MMI-PSA29.97-13-9~18929^2~450^2~11 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6d65e5eee6fc8fa9abef9e78e7e789c2cb06f95c;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git sctp: kzalloc() error handling on deleting last address Signed-off-by: Michio Honda Acked-by: Wei Yongjun Signed-off-by: David S. Miller --- 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 =