summaryrefslogtreecommitdiff
path: root/cpus.h
AgeCommit message (Collapse)AuthorFilesLines
2013-06-12cpus: let it always return an unsigned int and bail out on errorDaniel Borkmann1-4/+16
In case of an error, just panic, to make sure we always get a val >= 1. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
2013-06-04cpus: break out cpu related functions from xutilsDaniel Borkmann1-0/+16
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
d'>bf47dc572aaf53c3f2311c71e03ec01be3131fd6 (diff)
s390/crc32-vx: Fix checksum calculation for small sizes
The current prealign logic will fail for sizes < alignment, as the new datalen passed to the vector function is smaller than zero. Being a size_t this gets wrapped to a huge number causing memory overruns and wrong data. Let's add an early exit if the size is smaller than the minimal size with alignment. This will also avoid calling the software fallback twice for all sizes smaller than the minimum size (prealign + remaining) Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Fixes: f848dbd3bc1a ("s390/crc32-vx: add crypto API module for optimized CRC-32 algorithms") Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat