lkml.org 
[lkml]   [2020]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] lib/lz4: smatch warning in LZ4_decompress_generic()
Date
Found by smatch:
lib/lz4/lz4_decompress.c:150 LZ4_decompress_generic() warn: maybe use && instead of &
It was realy incorrectly copied from
https://github.com/lz4/lz4/commit/45f8603aae389d34c689d3ff7427b314071ccd2c
line 1431

Fixes: 2209fda323e2 ("lib/lz4: update LZ4 decompressor module")
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
lib/lz4/lz4_decompress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/lz4/lz4_decompress.c b/lib/lz4/lz4_decompress.c
index 0c9d3ad..f7f7dca 100644
--- a/lib/lz4/lz4_decompress.c
+++ b/lib/lz4/lz4_decompress.c
@@ -147,7 +147,7 @@ static FORCE_INLINE int LZ4_decompress_generic(
* strictly "less than" on input, to re-enter
* the loop with at least one byte
*/
- && likely((endOnInput ? ip < shortiend : 1) &
+ && likely((endOnInput ? ip < shortiend : 1) &&
(op <= shortoend))) {
/* Copy the literals */
memcpy(op, ip, endOnInput ? 16 : 8);
--
1.8.3.1
\
 
 \ /
  Last update: 2020-06-06 15:28    [W:0.058 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site