Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1271203

Re: [PATCH 2/4] crypto-ixp4xx: Two function calls less in init_ixp_crypto() after error detection

From Herbert Xu <herbert@gondor.apana.org.au>
Newsgroups linux.kernel
Subject Re: [PATCH 2/4] crypto-ixp4xx: Two function calls less in init_ixp_crypto() after error detection
Date 2015-11-17 14:50 +0100
Message-ID <qvONY-5HC-19@gated-at.bofh.it> (permalink)
References (5 earlier) <mSsDN-4wa-63@gated-at.bofh.it> <mSsDN-4wa-65@gated-at.bofh.it> <mSsDN-4wa-33@gated-at.bofh.it> <qvaxb-526-7@gated-at.bofh.it> <qvaGR-55G-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Nov 15, 2015 at 07:50:51PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 15 Nov 2015 18:28:39 +0100
> 
> The dma_pool_destroy() function was called twice with a null pointer
> if a "npe_error" was reported.
> 
> This implementation detail could be improved by the introduction
> of another jump label.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/crypto/ixp4xx_crypto.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c
> index e52496a..efe0eca 100644
> --- a/drivers/crypto/ixp4xx_crypto.c
> +++ b/drivers/crypto/ixp4xx_crypto.c
> @@ -509,9 +509,11 @@ static int init_ixp_crypto(struct device *dev)
>  npe_error:
>  	printk(KERN_ERR "%s not responding\n", npe_name(npe_c));
>  	ret = -EIO;
> +	goto release_npe;
>  err:
>  	dma_pool_destroy(ctx_pool);
>  	dma_pool_destroy(buffer_pool);
> +release_npe:
>  	npe_release(npe_c);
>  	return ret;

I think this patch is making the code worse so I'm not applying it.
-- 
Email: Herbert Xu <herbert@gondor.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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH 2/4] crypto-ixp4xx: Two function calls less in  init_ixp_crypto() after error detection Herbert Xu <herbert@gondor.apana.org.au> - 2015-11-17 14:50 +0100

csiph-web