struct scatterlist *in_sg = areq->src;
struct scatterlist *out_sg = areq->dst;
struct scatterlist *sg;
+ unsigned int todo, len;
if (areq->cryptlen == 0 || areq->cryptlen % 16) {
algt->stat_fb_len++;
return true;
}
+ len = areq->cryptlen;
sg = areq->src;
while (sg) {
- if ((sg->length % 16) != 0) {
- algt->stat_fb_sglen++;
- return true;
- }
- if ((sg_dma_len(sg) % 16) != 0) {
+ todo = min(len, sg->length);
+ if ((todo % 16) != 0) {
algt->stat_fb_sglen++;
return true;
}
algt->stat_fb_align++;
return true;
}
+ len -= todo;
sg = sg_next(sg);
}
+ len = areq->cryptlen;
sg = areq->dst;
while (sg) {
- if ((sg->length % 16) != 0) {
- algt->stat_fb_sglen++;
- return true;
- }
- if ((sg_dma_len(sg) % 16) != 0) {
+ todo = min(len, sg->length);
+ if ((todo % 16) != 0) {
algt->stat_fb_sglen++;
return true;
}
algt->stat_fb_align++;
return true;
}
+ len -= todo;
sg = sg_next(sg);
}