2011-03-15 06:58:06

by Dan Carpenter

[permalink] [raw]
Subject: [patch] crypto: caam - dereferencing ERR_PTR on allocation failure

t_alg is an ERR_PTR here so we can't dereference it.

Signed-off-by: Dan Carpenter <[email protected]>
---
This doesn't compile for me. Sorry.

diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index d7fe3d3..a27b6d3 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -1136,7 +1136,7 @@ static int __init caam_algapi_init(void)
if (IS_ERR(t_alg)) {
err = PTR_ERR(t_alg);
dev_warn(ctrldev, "%s alg allocation failed\n",
- t_alg->crypto_alg.cra_driver_name);
+ driver_algs[i].driver_name);
continue;
}



2011-03-15 22:35:43

by Kim Phillips

[permalink] [raw]
Subject: Re: [patch] crypto: caam - dereferencing ERR_PTR on allocation failure

On Tue, 15 Mar 2011 09:57:47 +0300
Dan Carpenter <[email protected]> wrote:

> t_alg is an ERR_PTR here so we can't dereference it.
>
> Signed-off-by: Dan Carpenter <[email protected]>
> ---

Acked-by: Kim Phillips <[email protected]>

Thanks,

Kim

2011-03-23 13:21:08

by Herbert Xu

[permalink] [raw]
Subject: Re: [patch] crypto: caam - dereferencing ERR_PTR on allocation failure

On Tue, Mar 15, 2011 at 05:20:34PM -0500, Kim Phillips wrote:
> On Tue, 15 Mar 2011 09:57:47 +0300
> Dan Carpenter <[email protected]> wrote:
>
> > t_alg is an ERR_PTR here so we can't dereference it.
> >
> > Signed-off-by: Dan Carpenter <er[email protected]>
> > ---
>
> Acked-by: Kim Phillips <[email protected]>

Applied.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt