lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 6 Jul 2010 15:03:56 +0800
From:	Herbert Xu <herbert@...dor.apana.org.au>
To:	"Justin P. Mattock" <justinmattock@...il.com>
Cc:	linux-crypto@...r.kernel.org, davem@...emloft.net, jkosina@...e.cz,
	linux-kernel@...r.kernel.org, justinmattock@...il.com
Subject: Re: [PATCH]crypto:hifn_795x.c Fix warning: variable 'ctx' set but
	not used

Justin P. Mattock <justinmattock@...il.com> wrote:
> The below fixes a warning message generated by GCC
>  CC [M]  drivers/crypto/hifn_795x.o
> drivers/crypto/hifn_795x.c: In function 'hifn_flush':
> drivers/crypto/hifn_795x.c:2021:23: warning: variable 'ctx' set but not used
> drivers/crypto/hifn_795x.c: In function 'hifn_process_queue':
> drivers/crypto/hifn_795x.c:2142:23: warning: variable 'ctx' set but not used
> 
> Please have a look, and let me know if this is legit or not.
> 
> Signed-off-by: Justin P. Mattock <justinmattock@...il.com>
> 
> ---
> drivers/crypto/hifn_795x.c |   10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
> index 16fce3a..e7aa4dc 100644
> --- a/drivers/crypto/hifn_795x.c
> +++ b/drivers/crypto/hifn_795x.c
> @@ -2036,6 +2036,11 @@ static void hifn_flush(struct hifn_device *dev)
>        spin_lock_irqsave(&dev->lock, flags);
>        while ((async_req = crypto_dequeue_request(&dev->queue))) {
>                ctx = crypto_tfm_ctx(async_req->tfm);
> +                       if (ctx) {
> +                               dprintk("%s: Flushing shash. %s\n", 
> +                               dev->name, ctx);
> +                               return;
> +                       } 

This certainly does not look right! Returning with IRQs disabled
is considered to be rude.

I believe the right answer is to delete the line initialising ctx.

Thanks,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ