WSL2-Linux-Kernel/arch/tile/lib
Chris Metcalf 3edabee2ed arch/tile: fix memchr() not to dereference memory for zero length
This change fixes a bug that memchr() will read the first word
of the source even if the length is zero.  Ironically, the code
was originally written with a test to avoid exactly this problem,
but to make the code conform to Linux coding standards with all
declarations preceding all statements, the first load from memory
was moved up above that test as the initial value for a variable.

The change just moves all the variable declarations to the top
of the file, with no initializers, so that the test can also be
at the top of the file.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
2010-11-24 13:57:42 -05:00
..
Makefile arch/tile: minor whitespace/naming changes for string support files 2010-10-15 15:38:54 -04:00
atomic_32.c tile: replace some BUG_ON checks with BUILD_BUG_ON checks 2010-10-05 12:49:35 -04:00
atomic_asm_32.S arch/tile: Fix bug in support for atomic64_xx() ops. 2010-07-06 13:41:39 -04:00
cacheflush.c arch/tile: Split the icache flush code off to a generic <arch> header. 2010-07-06 13:41:46 -04:00
checksum.c arch/tile: core support for Tilera 32-bit chips. 2010-06-04 17:11:18 -04:00
cpumask.c arch/tile: Miscellaneous cleanup changes. 2010-07-06 13:41:51 -04:00
delay.c arch/tile: core support for Tilera 32-bit chips. 2010-06-04 17:11:18 -04:00
exports.c arch/tile: properly export __mb_incoherent for modules 2010-10-14 15:12:55 -04:00
mb_incoherent.S arch/tile: core support for Tilera 32-bit chips. 2010-06-04 17:11:18 -04:00
memchr_32.c arch/tile: fix memchr() not to dereference memory for zero length 2010-11-24 13:57:42 -05:00
memcpy_32.S arch/tile: minor whitespace/naming changes for string support files 2010-10-15 15:38:54 -04:00
memcpy_tile64.c arch/tile: complete migration to new kmap_atomic scheme 2010-11-01 15:30:36 -04:00
memmove.c arch/tile: minor whitespace/naming changes for string support files 2010-10-15 15:38:54 -04:00
memset_32.c arch/tile: minor whitespace/naming changes for string support files 2010-10-15 15:38:54 -04:00
spinlock_32.c arch/tile: fix rwlock so would-be write lockers don't block new readers 2010-11-15 09:18:49 -05:00
spinlock_common.h arch/tile: Miscellaneous cleanup changes. 2010-07-06 13:41:51 -04:00
strchr_32.c arch/tile: core support for Tilera 32-bit chips. 2010-06-04 17:11:18 -04:00
strlen_32.c arch/tile: minor whitespace/naming changes for string support files 2010-10-15 15:38:54 -04:00
uaccess.c arch/tile: Miscellaneous cleanup changes. 2010-07-06 13:41:51 -04:00
usercopy_32.S arch/tile: core support for Tilera 32-bit chips. 2010-06-04 17:11:18 -04:00