Commit 747edc0f authored by wangweidong's avatar wangweidong Committed by David S. Miller

sctp: merge two if statements to one

Two if statements do the same work, we can merge them to
one. And fix some typos. There is just code simplification,
no functional changes.
Signed-off-by: default avatarWang Weidong <wangweidong1@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3dc0a548
...@@ -539,18 +539,14 @@ struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc) ...@@ -539,18 +539,14 @@ struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc)
for (i = 0; i < n_elt; i++) { for (i = 0; i < n_elt; i++) {
id = ntohs(hmacs->hmac_ids[i]); id = ntohs(hmacs->hmac_ids[i]);
/* Check the id is in the supported range */ /* Check the id is in the supported range. And
if (id > SCTP_AUTH_HMAC_ID_MAX) { * see if we support the id. Supported IDs have name and
id = 0; * length fields set, so that we can allocate and use
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 * them. We can safely just check for name, for without the
* name, we can't allocate the TFM. * name, we can't allocate the TFM.
*/ */
if (!sctp_hmac_list[id].hmac_name) { if (id > SCTP_AUTH_HMAC_ID_MAX ||
!sctp_hmac_list[id].hmac_name) {
id = 0; id = 0;
continue; continue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment