summaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2012-10-25 22:55:04 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2012-11-09 17:32:27 +0800
commitd48e366e6efe46e0a6744980c18582fb0919a727 (patch)
tree5875f5ebd96d8d6b243805f5b1bb0f0cc839a0c4 /drivers/crypto
parent3200da8d9afb3d0dc617515a2fe364d9d59ef523 (diff)
crypto: tegra-aes - fix error-valued pointer dereference
clk_put(dd->aes_clk) will dereference an error-valued pointer since the dd->aes_clk is a ERR_PTR() value. The correct check is call clk_put() if !IS_ERR(dd->aes_clk). dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/tegra-aes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/tegra-aes.c b/drivers/crypto/tegra-aes.c
index 19adf1c7faa..93059dc591a 100644
--- a/drivers/crypto/tegra-aes.c
+++ b/drivers/crypto/tegra-aes.c
@@ -1035,7 +1035,7 @@ out:
if (dd->buf_out)
dma_free_coherent(dev, AES_HW_DMA_BUFFER_SIZE_BYTES,
dd->buf_out, dd->dma_buf_out);
- if (IS_ERR(dd->aes_clk))
+ if (!IS_ERR(dd->aes_clk))
clk_put(dd->aes_clk);
if (aes_wq)
destroy_workqueue(aes_wq);