diff options
Diffstat (limited to 'net/ieee80211')
-rw-r--r-- | net/ieee80211/ieee80211_crypt_ccmp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ieee80211/ieee80211_crypt_ccmp.c b/net/ieee80211/ieee80211_crypt_ccmp.c index b016b4104de6..2e6b099fc84c 100644 --- a/net/ieee80211/ieee80211_crypt_ccmp.c +++ b/net/ieee80211/ieee80211_crypt_ccmp.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * more details. | 9 | * more details. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/kernel.h> | ||
12 | #include <linux/err.h> | 13 | #include <linux/err.h> |
13 | #include <linux/module.h> | 14 | #include <linux/module.h> |
14 | #include <linux/init.h> | 15 | #include <linux/init.h> |
@@ -241,7 +242,7 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
241 | hdr = (struct ieee80211_hdr_4addr *)skb->data; | 242 | hdr = (struct ieee80211_hdr_4addr *)skb->data; |
242 | ccmp_init_blocks(key->tfm, hdr, key->tx_pn, data_len, b0, b, s0); | 243 | ccmp_init_blocks(key->tfm, hdr, key->tx_pn, data_len, b0, b, s0); |
243 | 244 | ||
244 | blocks = (data_len + AES_BLOCK_LEN - 1) / AES_BLOCK_LEN; | 245 | blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN); |
245 | last = data_len % AES_BLOCK_LEN; | 246 | last = data_len % AES_BLOCK_LEN; |
246 | 247 | ||
247 | for (i = 1; i <= blocks; i++) { | 248 | for (i = 1; i <= blocks; i++) { |
@@ -351,7 +352,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
351 | ccmp_init_blocks(key->tfm, hdr, pn, data_len, b0, a, b); | 352 | ccmp_init_blocks(key->tfm, hdr, pn, data_len, b0, a, b); |
352 | xor_block(mic, b, CCMP_MIC_LEN); | 353 | xor_block(mic, b, CCMP_MIC_LEN); |
353 | 354 | ||
354 | blocks = (data_len + AES_BLOCK_LEN - 1) / AES_BLOCK_LEN; | 355 | blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN); |
355 | last = data_len % AES_BLOCK_LEN; | 356 | last = data_len % AES_BLOCK_LEN; |
356 | 357 | ||
357 | for (i = 1; i <= blocks; i++) { | 358 | for (i = 1; i <= blocks; i++) { |