linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: steffen.klassert@secunet.com
Cc: linux-crypto@vger.kernel.org
Subject: [bug report] padata: simplify serialization mechanism
Date: Tue, 11 Apr 2017 12:16:01 +0300	[thread overview]
Message-ID: <20170411091601.GA24844@mwanda> (raw)

Hello Steffen Klassert,

The patch 5f1a8c1bc724: "padata: simplify serialization mechanism"
from Jul 7, 2010, leads to the following static checker warning:

	kernel/padata.c:243 padata_reorder()
	warn: 'padata' is an error pointer or valid

kernel/padata.c
   231          if (!spin_trylock_bh(&pd->lock))
   232                  return;
   233  
   234          while (1) {
   235                  padata = padata_get_next(pd);
   236  
   237                  /*
   238                   * All reorder queues are empty, or the next object that needs
   239                   * serialization is parallel processed by another cpu and is
   240                   * still on it's way to the cpu's reorder queue, nothing to
   241                   * do for now.
   242                   */
   243                  if (!padata || PTR_ERR(padata) == -EINPROGRESS)
                             ^^^^^^
The comments still say that we sometimes return NULL but we removed that
in 2010.

   244                          break;
   245  
   246                  /*
   247                   * This cpu has to do the parallel processing of the next
   248                   * object. It's waiting in the cpu's parallelization queue,
   249                   * so exit immediately.
   250                   */
   251                  if (PTR_ERR(padata) == -ENODATA) {
   252                          del_timer(&pd->timer);
   253                          spin_unlock_bh(&pd->lock);
   254                          return;
   255                  }

regards,
dan carpenter

             reply	other threads:[~2017-04-11  9:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11  9:16 Dan Carpenter [this message]
2017-04-12  8:40 ` [PATCH] padata: get_next is never NULL Jason A. Donenfeld
2017-04-14  7:46   ` Steffen Klassert

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=20170411091601.GA24844@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    /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).