All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: dhowells@redhat.com, linux-afs@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: Logically dead code at fs/afs/cell.c:206
Date: Fri, 17 Nov 2017 22:21:47 +0000	[thread overview]
Message-ID: <4923.1510957307@warthog.procyon.org.uk> (raw)
In-Reply-To: <20171117215732.GA15974@embeddedor.com>

Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:

> Today Coverity reported a "Logically dead code" issue at fs/afs/cell.c:206:
> 
>         if (!excl) {
>                 rcu_read_lock();
>                 cell = afs_lookup_cell_rcu(net, name, namesz);
>                 rcu_read_unlock();
>                 if (!IS_ERR(cell)) {
>                         if (excl) {
>                                 afs_put_cell(net, cell);
>                                 return ERR_PTR(-EEXIST);
>                         }
>                         goto wait_for_cell;
>                 }
>         }
> 
> The problem is that when this code block is executed, the code block
> starting at line 211 makes no sense, as _excl_ can never be true.

Good catch.  The interior "if (excl) { ... }" statement and body needs
removing entirely.  Originally the outer "if (!excl)" wrapping it wasn't
there.

David

  reply	other threads:[~2017-11-17 22:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-17 21:57 Logically dead code at fs/afs/cell.c:206 Gustavo A. R. Silva
2017-11-17 22:21 ` David Howells [this message]
2017-11-17 22:26   ` Gustavo A. R. Silva

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=4923.1510957307@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=garsilva@embeddedor.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@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.