* [patch] crypto: sahara - checking the wrong variable
@ 2013-08-20 8:51 Dan Carpenter
2013-08-21 11:51 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-08-20 8:51 UTC (permalink / raw)
To: Herbert Xu
Cc: David S. Miller, Grant Likely, Rob Herring, linux-crypto,
devicetree, kernel-janitors
There is a typo here. "dev->hw_link[]" is an array, not a pointer, so
the check is nonsense. We should be checking recently allocated
"dev->hw_link[0]" instead.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index b076d81..d7bb8ba 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -955,7 +955,7 @@ static int sahara_probe(struct platform_device *pdev)
dev->hw_link[0] = dma_alloc_coherent(&pdev->dev,
SAHARA_MAX_HW_LINK * sizeof(struct sahara_hw_link),
&dev->hw_phys_link[0], GFP_KERNEL);
- if (!dev->hw_link) {
+ if (!dev->hw_link[0]) {
dev_err(&pdev->dev, "Could not allocate hw links\n");
err = -ENOMEM;
goto err_link;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] crypto: sahara - checking the wrong variable
2013-08-20 8:51 [patch] crypto: sahara - checking the wrong variable Dan Carpenter
@ 2013-08-21 11:51 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2013-08-21 11:51 UTC (permalink / raw)
To: Dan Carpenter
Cc: David S. Miller, Grant Likely, Rob Herring, linux-crypto,
devicetree, kernel-janitors
On Tue, Aug 20, 2013 at 11:51:41AM +0300, Dan Carpenter wrote:
> There is a typo here. "dev->hw_link[]" is an array, not a pointer, so
> the check is nonsense. We should be checking recently allocated
> "dev->hw_link[0]" instead.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Patch applied.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-21 11:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-20 8:51 [patch] crypto: sahara - checking the wrong variable Dan Carpenter
2013-08-21 11:51 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox