diff options
-rw-r--r-- | drivers/crypto/hifn_795x.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c index ab4f94bec4ff..0c79fe7f1567 100644 --- a/drivers/crypto/hifn_795x.c +++ b/drivers/crypto/hifn_795x.c | |||
@@ -1393,10 +1393,12 @@ static int hifn_setup_dma(struct hifn_device *dev, | |||
1393 | n = nbytes; | 1393 | n = nbytes; |
1394 | while (n) { | 1394 | while (n) { |
1395 | if (t->length && rctx->walk.flags & ASYNC_FLAGS_MISALIGNED) { | 1395 | if (t->length && rctx->walk.flags & ASYNC_FLAGS_MISALIGNED) { |
1396 | BUG_ON(!sg_page(t)); | ||
1396 | dpage = sg_page(t); | 1397 | dpage = sg_page(t); |
1397 | doff = 0; | 1398 | doff = 0; |
1398 | len = t->length; | 1399 | len = t->length; |
1399 | } else { | 1400 | } else { |
1401 | BUG_ON(!sg_page(dst)); | ||
1400 | dpage = sg_page(dst); | 1402 | dpage = sg_page(dst); |
1401 | doff = dst->offset; | 1403 | doff = dst->offset; |
1402 | len = dst->length; | 1404 | len = dst->length; |
@@ -1791,17 +1793,17 @@ static void hifn_process_ready(struct ablkcipher_request *req, int error) | |||
1791 | continue; | 1793 | continue; |
1792 | } | 1794 | } |
1793 | 1795 | ||
1794 | saddr = kmap_atomic(sg_page(t), KM_IRQ1); | 1796 | saddr = kmap_atomic(sg_page(t), KM_SOFTIRQ0); |
1795 | 1797 | ||
1796 | err = ablkcipher_get(saddr, &t->length, t->offset, | 1798 | err = ablkcipher_get(saddr, &t->length, t->offset, |
1797 | dst, nbytes, &nbytes); | 1799 | dst, nbytes, &nbytes); |
1798 | if (err < 0) { | 1800 | if (err < 0) { |
1799 | kunmap_atomic(saddr, KM_IRQ1); | 1801 | kunmap_atomic(saddr, KM_SOFTIRQ0); |
1800 | break; | 1802 | break; |
1801 | } | 1803 | } |
1802 | 1804 | ||
1803 | idx += err; | 1805 | idx += err; |
1804 | kunmap_atomic(saddr, KM_IRQ1); | 1806 | kunmap_atomic(saddr, KM_SOFTIRQ0); |
1805 | } | 1807 | } |
1806 | 1808 | ||
1807 | ablkcipher_walk_exit(&rctx->walk); | 1809 | ablkcipher_walk_exit(&rctx->walk); |