Re: [PATCH] crypto: shash - Handle failures in crypto_alloc_shash() correctly

2009-02-18 Thread Geert Uytterhoeven
On Wed, 18 Feb 2009, Herbert Xu wrote: > On Wed, Feb 18, 2009 at 10:59:13AM +0100, Geert Uytterhoeven wrote: > > But if you put stuff in your crypto_* before base, you still need the > > special > > translation (and check for IS_ERR()). > > You've lost me. With my patch crypto_create_tfm will ei

Re: [PATCH] crypto: shash - Handle failures in crypto_alloc_shash() correctly

2009-02-18 Thread Herbert Xu
On Wed, Feb 18, 2009 at 10:59:13AM +0100, Geert Uytterhoeven wrote: > > But if you put stuff in your crypto_* before base, you still need the special > translation (and check for IS_ERR()). You've lost me. With my patch crypto_create_tfm will either return the pointer to the start of the area al

Re: [PATCH] crypto: shash - Handle failures in crypto_alloc_shash() correctly

2009-02-18 Thread Geert Uytterhoeven
On Wed, 18 Feb 2009, Herbert Xu wrote: > On Wed, Feb 18, 2009 at 10:07:38AM +0100, Geert Uytterhoeven wrote: > > > > Yep, I haven't tried it yet, but it looks OK. > > > > The only caveat is that crypto_*.base must always be at offset zero now. > > Why is that? We still add the size given by the f

Re: [PATCH] crypto: shash - Handle failures in crypto_alloc_shash() correctly

2009-02-18 Thread Herbert Xu
On Wed, Feb 18, 2009 at 10:07:38AM +0100, Geert Uytterhoeven wrote: > > Yep, I haven't tried it yet, but it looks OK. > > The only caveat is that crypto_*.base must always be at offset zero now. Why is that? We still add the size given by the frontend. Cheers, -- Visit Openswan at http://www.op

Re: [PATCH] crypto: shash - Handle failures in crypto_alloc_shash() correctly

2009-02-18 Thread Geert Uytterhoeven
On Wed, 18 Feb 2009, Herbert Xu wrote: > On Tue, Feb 17, 2009 at 06:46:40PM +0100, Geert Uytterhoeven wrote: > > crypto_alloc_tfm() returns an error-valued pointer in case of failure, > > which must not be translated using __crypto_shash_cast(). > > > > Currently everything works fine because __cr

Re: [PATCH] crypto: shash - Handle failures in crypto_alloc_shash() correctly

2009-02-18 Thread Herbert Xu
On Tue, Feb 17, 2009 at 06:46:40PM +0100, Geert Uytterhoeven wrote: > crypto_alloc_tfm() returns an error-valued pointer in case of failure, > which must not be translated using __crypto_shash_cast(). > > Currently everything works fine because __crypto_shash_cast() is a no-op > (crypto_shash.base

[PATCH] crypto: shash - Handle failures in crypto_alloc_shash() correctly

2009-02-17 Thread Geert Uytterhoeven
crypto_alloc_tfm() returns an error-valued pointer in case of failure, which must not be translated using __crypto_shash_cast(). Currently everything works fine because __crypto_shash_cast() is a no-op (crypto_shash.base is at offset zero). Signed-off-by: Geert Uytterhoeven --- crypto/shash.c |