kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [bug report] caif_virtio: Introduce caif over virtio
Date: Sat, 02 Nov 2019 10:11:19 +0000	[thread overview]
Message-ID: <20191102101119.GA23109@mwanda> (raw)

Hello Erwan Yvin,

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

The patch 0d2e1a2926b1: "caif_virtio: Introduce caif over virtio" 
from Mar 20, 2013, leads to the following Smatch complaint:

    drivers/net/caif/caif_virtio.c:190 cfv_release_used_buf()
    warn: variable dereferenced before check 'cfv->genpool' (see line 180)

drivers/net/caif/caif_virtio.c
   179	
   180			free_buf_info(cfv, buf_info);
                                      ^^^
Dereference inside the function.

   181	
   182			/* watermark_tx indicates if we previously stopped the tx
   183			 * queues. If we have enough free stots in the virtio ring,
   184			 * re-establish memory reserved and open up tx queues.
   185			 */
   186			if (cfv->vq_tx->num_free <= cfv->watermark_tx)
   187				continue;
   188	
   189			/* Re-establish memory reserve */
   190			if (cfv->reserved_mem = 0 && cfv->genpool)
                                                      ^^^^^^^^^^^^
Checked too late.

   191				cfv->reserved_mem    192					gen_pool_alloc(cfv->genpool,

regards,
dan carpenter

                 reply	other threads:[~2019-11-02 10:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20191102101119.GA23109@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).