diff options
Diffstat (limited to 'net/ieee80211/ieee80211_crypt_wep.c')
-rw-r--r-- | net/ieee80211/ieee80211_crypt_wep.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/ieee80211/ieee80211_crypt_wep.c b/net/ieee80211/ieee80211_crypt_wep.c index 8d182459344e..0af6103d715c 100644 --- a/net/ieee80211/ieee80211_crypt_wep.c +++ b/net/ieee80211/ieee80211_crypt_wep.c | |||
@@ -170,9 +170,7 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
170 | icv[3] = crc >> 24; | 170 | icv[3] = crc >> 24; |
171 | 171 | ||
172 | crypto_blkcipher_setkey(wep->tx_tfm, key, klen); | 172 | crypto_blkcipher_setkey(wep->tx_tfm, key, klen); |
173 | sg.page = virt_to_page(pos); | 173 | sg_init_one(&sg, pos, len + 4); |
174 | sg.offset = offset_in_page(pos); | ||
175 | sg.length = len + 4; | ||
176 | return crypto_blkcipher_encrypt(&desc, &sg, &sg, len + 4); | 174 | return crypto_blkcipher_encrypt(&desc, &sg, &sg, len + 4); |
177 | } | 175 | } |
178 | 176 | ||
@@ -212,9 +210,7 @@ static int prism2_wep_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
212 | plen = skb->len - hdr_len - 8; | 210 | plen = skb->len - hdr_len - 8; |
213 | 211 | ||
214 | crypto_blkcipher_setkey(wep->rx_tfm, key, klen); | 212 | crypto_blkcipher_setkey(wep->rx_tfm, key, klen); |
215 | sg.page = virt_to_page(pos); | 213 | sg_init_one(&sg, pos, plen + 4); |
216 | sg.offset = offset_in_page(pos); | ||
217 | sg.length = plen + 4; | ||
218 | if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) | 214 | if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) |
219 | return -7; | 215 | return -7; |
220 | 216 | ||