diff options
author | Steven Miao <realmz6@gmail.com> | 2011-06-01 09:52:41 +0200 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-06-03 17:05:36 +0200 |
commit | 5ff6197f828d5ea051b3abf77cb61f8a34480e8d (patch) | |
tree | 4d40c726ed8b09f1cd184f972641edc99a8c07b8 /arch | |
parent | Revert "mm: fail GFP_DMA allocations when ZONE_DMA is not configured" (diff) | |
download | linux-5ff6197f828d5ea051b3abf77cb61f8a34480e8d.tar.xz linux-5ff6197f828d5ea051b3abf77cb61f8a34480e8d.zip |
Blackfin: strncpy: fix handling of zero lengths
The jump to 4f will cause the NUL padding loop to run at least one time,
so if string length is zero just jump to the end. Otherwise we wrongly
write one NUL byte when size==0.
Signed-off-by: Steven Miao <realmz6@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/blackfin/lib/strncpy.S | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/blackfin/lib/strncpy.S b/arch/blackfin/lib/strncpy.S index f3931d50b4a7..2c07dddac995 100644 --- a/arch/blackfin/lib/strncpy.S +++ b/arch/blackfin/lib/strncpy.S @@ -25,7 +25,7 @@ ENTRY(_strncpy) CC = R2 == 0; - if CC JUMP 4f; + if CC JUMP 6f; P2 = R2 ; /* size */ P0 = R0 ; /* dst*/ |