diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 62d3cc155809..a5f2835dbe0f 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -999,6 +999,10 @@ static void sctp_assoc_bh_rcv(struct work_struct *work) if (next_hdr->type == SCTP_CID_COOKIE_ECHO) { chunk->auth_chunk = skb_clone(chunk->skb, GFP_ATOMIC); + if (!chunk->auth_chunk) { + chunk->pdiscard = 1; + continue; + } chunk->auth = 1; continue; } diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index dfb1719275db..a15b599b20b7 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c @@ -368,6 +368,10 @@ static void sctp_endpoint_bh_rcv(struct work_struct *work) if (next_hdr->type == SCTP_CID_COOKIE_ECHO) { chunk->auth_chunk = skb_clone(chunk->skb, GFP_ATOMIC); + if (!chunk->auth_chunk) { + chunk->pdiscard = 1; + continue; + } chunk->auth = 1; continue; }