diff options
author | David S. Miller <davem@davemloft.net> | 2015-02-17 18:48:51 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-17 18:48:51 -0800 |
commit | 11af4409245096cef96a41327ed970f8789e1c1c (patch) | |
tree | 80621c6623aa54dceafc5743c8a016b609d7dc46 /crypto/ablkcipher.c | |
parent | baefc38c7ec56afcfa92594930b747a050c599b7 (diff) | |
parent | 9ece59e8fd3d017e04382709a4d48e81e00246fb (diff) | |
download | linux-crypto-11af4409245096cef96a41327ed970f8789e1c1c.tar.gz linux-crypto-11af4409245096cef96a41327ed970f8789e1c1c.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'crypto/ablkcipher.c')
-rw-r--r-- | crypto/ablkcipher.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c index 40886c48..db201bca 100644 --- a/crypto/ablkcipher.c +++ b/crypto/ablkcipher.c @@ -69,6 +69,7 @@ static inline void ablkcipher_queue_write(struct ablkcipher_walk *walk, static inline u8 *ablkcipher_get_spot(u8 *start, unsigned int len) { u8 *end_page = (u8 *)(((unsigned long)(start + len - 1)) & PAGE_MASK); + return max(start, end_page); } @@ -86,7 +87,7 @@ static inline unsigned int ablkcipher_done_slow(struct ablkcipher_walk *walk, if (n == len_this_page) break; n -= len_this_page; - scatterwalk_start(&walk->out, scatterwalk_sg_next(walk->out.sg)); + scatterwalk_start(&walk->out, sg_next(walk->out.sg)); } return bsize; @@ -284,6 +285,7 @@ static int ablkcipher_walk_first(struct ablkcipher_request *req, walk->iv = req->info; if (unlikely(((unsigned long)walk->iv & alignmask))) { int err = ablkcipher_copy_iv(walk, tfm, alignmask); + if (err) return err; } @@ -589,7 +591,8 @@ static int crypto_givcipher_default(struct crypto_alg *alg, u32 type, u32 mask) if (IS_ERR(inst)) goto put_tmpl; - if ((err = crypto_register_instance(tmpl, inst))) { + err = crypto_register_instance(tmpl, inst); + if (err) { tmpl->free(inst); goto put_tmpl; } |