re: crypto: echainiv - Add encrypted chain IV generator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux