Crypto/chcr: Calculate src and dst sg lengths separately for dma map
authorAyush Sawal <ayush.sawal@chelsio.com>
Tue, 9 Jun 2020 21:24:31 +0000 (02:54 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Jun 2020 00:05:02 +0000 (17:05 -0700)
commitfb90a1c85d8f08c85d9fd5729bfdeb786119f219
tree12e1766cd5899d61e1c149f98ed6f3aeff5f2e3f
parent934e36ec5e81b8bc079f3d7acd12beb16cad9531
Crypto/chcr: Calculate src and dst sg lengths separately for dma map

This patch calculates src and dst sg lengths separately for
dma mapping in case of aead operation.

This fixes a panic which occurs due to the accessing of a zero
length sg.
Panic:
[  138.173225] kernel BUG at drivers/iommu/intel-iommu.c:1184!

Signed-off-by: Ayush Sawal <ayush.sawal@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/crypto/chelsio/chcr_algo.c