]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sctp/associola.c
[SCTP]: Fix kernel panic while received ASCONF chunk with bad serial number
[linux-2.6-omap-h63xx.git] / net / sctp / associola.c
index 13931a91f6670a3c1beecc3791c767f4176c8be1..d29f792e0529d78cebbd3a3ec55c8e8a95e63f4b 100644 (file)
@@ -1525,7 +1525,7 @@ struct sctp_chunk *sctp_assoc_lookup_asconf_ack(
                                        const struct sctp_association *asoc,
                                        __be32 serial)
 {
-       struct sctp_chunk *ack = NULL;
+       struct sctp_chunk *ack;
 
        /* Walk through the list of cached ASCONF-ACKs and find the
         * ack chunk whose serial number matches that of the request.
@@ -1533,9 +1533,9 @@ struct sctp_chunk *sctp_assoc_lookup_asconf_ack(
        list_for_each_entry(ack, &asoc->asconf_ack_list, transmitted_list) {
                if (ack->subh.addip_hdr->serial == serial) {
                        sctp_chunk_hold(ack);
-                       break;
+                       return ack;
                }
        }
 
-       return ack;
+       return NULL;
 }