diff options
Diffstat (limited to 'net/sctp/auth.c')
| -rw-r--r-- | net/sctp/auth.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/sctp/auth.c b/net/sctp/auth.c index 56935bbc1496..ddbbf7c81fa1 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | * be incorporated into the next SCTP release. | 34 | * be incorporated into the next SCTP release. |
| 35 | */ | 35 | */ |
| 36 | 36 | ||
| 37 | #include <linux/slab.h> | ||
| 37 | #include <linux/types.h> | 38 | #include <linux/types.h> |
| 38 | #include <linux/crypto.h> | 39 | #include <linux/crypto.h> |
| 39 | #include <linux/scatterlist.h> | 40 | #include <linux/scatterlist.h> |
| @@ -542,16 +543,20 @@ struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc) | |||
| 542 | id = ntohs(hmacs->hmac_ids[i]); | 543 | id = ntohs(hmacs->hmac_ids[i]); |
| 543 | 544 | ||
| 544 | /* Check the id is in the supported range */ | 545 | /* Check the id is in the supported range */ |
| 545 | if (id > SCTP_AUTH_HMAC_ID_MAX) | 546 | if (id > SCTP_AUTH_HMAC_ID_MAX) { |
| 547 | id = 0; | ||
| 546 | continue; | 548 | continue; |
| 549 | } | ||
| 547 | 550 | ||
| 548 | /* See is we support the id. Supported IDs have name and | 551 | /* See is we support the id. Supported IDs have name and |
| 549 | * length fields set, so that we can allocated and use | 552 | * length fields set, so that we can allocated and use |
| 550 | * them. We can safely just check for name, for without the | 553 | * them. We can safely just check for name, for without the |
| 551 | * name, we can't allocate the TFM. | 554 | * name, we can't allocate the TFM. |
| 552 | */ | 555 | */ |
| 553 | if (!sctp_hmac_list[id].hmac_name) | 556 | if (!sctp_hmac_list[id].hmac_name) { |
| 557 | id = 0; | ||
| 554 | continue; | 558 | continue; |
| 559 | } | ||
| 555 | 560 | ||
| 556 | break; | 561 | break; |
| 557 | } | 562 | } |
