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: upstream/snapshot3+hdmi~9624^2~450^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d65e5eee6fc8fa9abef9e78e7e789c2cb06f95c;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.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 e7e1b14..60038fe 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 =