Thread (1 message) 1 message, 1 author, 11h ago

Re: [PATCH RFC 1/9] lib/lz4: import upstream LZ4 sources verbatim

From: Sergey Senozhatsky <senozhatsky@chromium.org>
Date: 2026-09-28 05:19:21
Also in: linux-block, linux-crypto, linux-f2fs-devel, linux-mips, linux-s390, lkml, llvm

On (26/09/25 13:27), Michal Wilczynski wrote:
[..]
+int LZ4_compress_fast_extState(void* state, const char* source, char* dest, int inputSize, int maxOutputSize, int acceleration)
+{
+    LZ4_stream_t_internal* const ctx = & LZ4_initStream(state, sizeof(LZ4_stream_t)) -> internal_donotuse;
+    assert(ctx != NULL);
Probably in some other places as well:

LZ4_initStream() can return NULL, but the code immediately derefs
the pointer.  The assert() check seems to be misplaced, unless I'm
missing something.

I suppose those need to be decoupled.  First LZ4_initStream() call and
NULL check, then stream->internal_donotuse.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help