All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [bug report] lib: update LZ4 compressor module
Date: Tue, 31 Jan 2017 10:41:04 +0000	[thread overview]
Message-ID: <20170131104104.GA27172@mwanda> (raw)

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

             reply	other threads:[~2017-01-31 10:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-31 10:41 Dan Carpenter [this message]
2017-01-31 10:43 ` [bug report] lib: update LZ4 compressor module Dan Carpenter
2017-01-31 12:09 ` Sven Schmidt (4sschmid)
2017-01-31 16:36 ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170131104104.GA27172@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.