All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: herbert@gondor.apana.org.au
Cc: linux-crypto@vger.kernel.org
Subject: re: crypto: echainiv - Add encrypted chain IV generator
Date: Tue, 26 May 2015 12:36:45 +0300	[thread overview]
Message-ID: <20150526093645.GA2233@mwanda> (raw)

Hello Herbert Xu,

The patch a10f554fa7e0: "crypto: echainiv - Add encrypted chain IV
generator" from May 21, 2015, leads to the following static checker
warning:

	crypto/echainiv.c:492 echainiv_alloc()
	warn: 'inst' isn't an ERR_PTR

crypto/echainiv.c
   435  static struct crypto_instance *echainiv_aead_alloc(struct rtattr **tb)
   436  {
   437          struct aead_instance *inst;
   438          struct crypto_aead_spawn *spawn;
   439          struct aead_alg *alg;
   440  
   441          inst = aead_geniv_alloc(&echainiv_tmpl, tb, 0, 0);
   442  
   443          if (IS_ERR(inst))
   444                  goto out;
   445  
   446          if (inst->alg.ivsize < sizeof(u64) ||
   447              inst->alg.ivsize & (sizeof(u32) - 1) ||
   448              inst->alg.ivsize > MAX_IV_SIZE) {
   449                  aead_geniv_free(inst);
   450                  inst = ERR_PTR(-EINVAL);
   451                  goto out;
                        ^^^^^^^^
Goto out here means return the container_of() an error pointer.  This
is a class of bugs called a "one err bug" because all the error paths
go to the same error label.

   452          }
   453  

regards,
dan carpenter

                 reply	other threads:[~2015-05-26 14:14 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=20150526093645.GA2233@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@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.