mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 23:40:53 +07:00
cryptocop: fix assertion in create_output_descriptors()
size_t desc_len cannot be less than 0, test before the subtraction. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Mikael Starvik <starvik@axis.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
ba875ba6b7
commit
cda1c5af26
@ -628,9 +628,9 @@ static int create_output_descriptors(struct cryptocop_operation *operation, int
|
|||||||
cdesc->dma_descr->buf = (char*)virt_to_phys(operation->tfrm_op.indata[*iniov_ix].iov_base + *iniov_offset);
|
cdesc->dma_descr->buf = (char*)virt_to_phys(operation->tfrm_op.indata[*iniov_ix].iov_base + *iniov_offset);
|
||||||
cdesc->dma_descr->after = cdesc->dma_descr->buf + dlength;
|
cdesc->dma_descr->after = cdesc->dma_descr->buf + dlength;
|
||||||
|
|
||||||
|
assert(desc_len >= dlength);
|
||||||
desc_len -= dlength;
|
desc_len -= dlength;
|
||||||
*iniov_offset += dlength;
|
*iniov_offset += dlength;
|
||||||
assert(desc_len >= 0);
|
|
||||||
if (*iniov_offset >= operation->tfrm_op.indata[*iniov_ix].iov_len) {
|
if (*iniov_offset >= operation->tfrm_op.indata[*iniov_ix].iov_len) {
|
||||||
*iniov_offset = 0;
|
*iniov_offset = 0;
|
||||||
++(*iniov_ix);
|
++(*iniov_ix);
|
||||||
|
Loading…
Reference in New Issue
Block a user