Re: [PATCH v0] Crypto: Talitos: re-initialize async_tx descriptors
From: Dan Williams <hidden>
Date: 2009-12-15 07:29:24
Also in:
linux-crypto, linux-raid, lkml
On Mon, Dec 14, 2009 at 6:33 AM, Vishnu Suresh [off-list ref] wrote= :
quoted hunk ↗ jump to hunk
The async_tx descriptors contains dangling pointers. Hence, re-initialize them to NULL before use. Signed-off-by: Vishnu Suresh <redacted> --- o. Rebased to linux-next as of 20091214 =A0drivers/crypto/talitos.c | =A0 =A03 +++ =A01 files changed, 3 insertions(+), 0 deletions(-)diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 87f06be..9e261c6 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c@@ -952,6 +952,9 @@ static struct dma_async_tx_descriptor * talitos_prep_=
dma_xor(
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return NULL; =A0 =A0 =A0 =A0} =A0 =A0 =A0 =A0dma_async_tx_descriptor_init(&new->async_tx, &xor_chan->co=
mmon);
+ =A0 =A0 =A0 new->async_tx.parent =3D NULL; + =A0 =A0 =A0 new->async_tx.next =3D NULL; + =A0 =A0 =A0 =A0desc =3D &new->hwdesc; =A0 =A0 =A0 =A0/* Set destination: Last pointer pair */
These two values are owned by the async_tx api, drivers are not supposed to touch them. Both iop_adma and the new ppx4xx driver (which use the async_tx channel switching capability) get away without touching these fields which makes me suspect there is a misunderstanding/bug somewhere else in the talitos implementation. Also that dma_async_tx_descriptor_init() is unexpected in the hot path, it's only needed at initial descriptor allocation. End result I think this driver needs some more time to brew. -- Dan