lkml.org 
[lkml]   [2009]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH crypto -v4 1/2] AES-NI: Add support to access underlying blkcipher under cryptd ablkcipher
On Thu, Jan 15, 2009 at 04:28:33PM +0800, Huang Ying wrote:
>
> + tfm = crypto_alloc_ablkcipher(cryptd_alg_name, type, mask);
> + BUG_ON(crypto_ablkcipher_tfm(tfm)->__crt_alg->cra_module !=
> + THIS_MODULE);

You need to check whether tfm is an error before dereferencing it.
Also it's probably better to free the tfm and return an error rather
than invoking BUG.

> --- a/include/crypto/algapi.h
> +++ b/include/crypto/algapi.h

Please create a new file for this, e.g., include/crypto/cryptd.h.

Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


\
 
 \ /
  Last update: 2009-01-15 09:51    [W:0.067 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site