--- 914c41978f522a1e6371a9888ce909c8597bd033 +++ 56935bbc1496f535e646d2e8ef03c9bddb3a2634 @@ -542,20 +542,16 @@ struct sctp_hmac *sctp_auth_asoc_get_hma id = ntohs(hmacs->hmac_ids[i]); /* Check the id is in the supported range */ - if (id > SCTP_AUTH_HMAC_ID_MAX) { - id = 0; + if (id > SCTP_AUTH_HMAC_ID_MAX) continue; - } /* See is we support the id. Supported IDs have name and * length fields set, so that we can allocated and use * them. We can safely just check for name, for without the * name, we can't allocate the TFM. */ - if (!sctp_hmac_list[id].hmac_name) { - id = 0; + if (!sctp_hmac_list[id].hmac_name) continue; - } break; }