From: Krzysztof Halasa <khc@pm.waw.pl>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Christian Hohnstaedt <chohnstaedt@innominate.com>,
linux-crypto@vger.kernel.org
Subject: ixp4xx_crypto: Fix possible NULL ptr dereference.
Date: Sun, 10 Jan 2010 18:37:25 +0100 [thread overview]
Message-ID: <m3eilx3lpm.fsf@intrepid.localdomain> (raw)
In-Reply-To: <m34omu3rf7.fsf@intrepid.localdomain> (Krzysztof Halasa's message of "Sun, 10 Jan 2010 16:35:38 +0100")
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c
index f8f6515..2ae7148 100644
--- a/drivers/crypto/ixp4xx_crypto.c
+++ b/drivers/crypto/ixp4xx_crypto.c
@@ -786,10 +786,8 @@ static struct buffer_desc *chainup_buffers(struct device *dev,
nbytes -= len;
ptr = page_address(sg_page(sg)) + sg->offset;
next_buf = dma_pool_alloc(buffer_pool, flags, &next_buf_phys);
- if (!next_buf) {
- buf = NULL;
- break;
- }
+ if (!next_buf)
+ return NULL;
sg_dma_address(sg) = dma_map_single(dev, ptr, len, dir);
buf->next = next_buf;
buf->phys_next = next_buf_phys;
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-01-10 17:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-10 15:34 [6 PATCHes] IXP4xx crypto driver fixes Krzysztof Halasa
2010-01-10 17:30 ` Krzysztof Halasa
2010-01-11 9:07 ` Christian Hohnstaedt
2010-01-10 17:32 ` IXP4xx: Fix ixp4xx_crypto sparse warnings Krzysztof Halasa
2010-01-10 17:32 ` IXP4xx: Simplify get_crypt_desc() and get_crypt_desc_emerg() in ixp4xx_crypto Krzysztof Halasa
2010-01-10 17:33 ` IXP4xx: Fix whitespace problems " Krzysztof Halasa
2010-01-12 17:12 ` Christian Hohnstaedt
2010-01-12 18:09 ` Krzysztof Halasa
2010-01-10 17:37 ` Krzysztof Halasa [this message]
2010-01-11 10:07 ` ixp4xx_crypto: Fix possible NULL ptr dereference Christian Hohnstaedt
2010-01-10 17:37 ` ixp4xx_crypto: simplyfy the code a bit Krzysztof Halasa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3eilx3lpm.fsf@intrepid.localdomain \
--to=khc@pm.waw.pl \
--cc=chohnstaedt@innominate.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox