public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] lib: update LZ4 compressor module
@ 2017-01-31 10:41 Dan Carpenter
  2017-01-31 10:43 ` Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-01-31 10:41 UTC (permalink / raw)
  To: kernel-janitors

Hello Sven Schmidt,

This is a semi-automatic email about new static checker warnings.

The patch e355e356f87b: "lib: update LZ4 compressor module" from Jan 
25, 2017, leads to the following Smatch complaint:

lib/lz4/lz4_compress.c:890 lz4_compress()
	 warn: variable dereferenced before check 'dst_len' (see line 880)

lib/lz4/lz4_compress.c
   879		size_t *dst_len, void *wrkmem) {
   880		*dst_len = LZ4_compress_default(src, dst, (int)src_len,
                 ^^^^^^^
Dereference.

   881			(int)((size_t)dst_len), wrkmem);
   882	
   883		/*
   884		 * Prior lz4_compress will return -1 in case of error
   885		 * and 0 on success
   886		 * while new LZ4_compress_fast/default
   887		 * returns 0 in case of error
   888		 * and the output length on success
   889		 */
   890		if (!dst_len)
                     ^^^^^^^
Checked too late.  Can this test just be deleted?

   891			return -1;
   892		else

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-31 16:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-31 10:41 [bug report] lib: update LZ4 compressor module Dan Carpenter
2017-01-31 10:43 ` Dan Carpenter
2017-01-31 12:09 ` Sven Schmidt (4sschmid)
2017-01-31 16:36 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox