[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181008191712.GA12892@embeddedor.com>
Date: Mon, 8 Oct 2018 21:17:12 +0200
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Antoine Tenart <antoine.tenart@...tlin.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Kees Cook <keescook@...omium.org>
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>
Subject: [PATCH] crypto: inside-secure: safexcel - fix memory allocation
The original intention is to allocate space for EIP197_DEFAULT_RING_SIZE
*pointers* to struct, so sizeof(priv->ring[i].rdr_req) should be
sizeof(*priv->ring[i].rdr_req).
Addresses-Coverity-ID: 1473962 ("Sizeof not portable")
Fixes: 9744fec95f06 ("crypto: inside-secure - remove request list to improve performance")
Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
---
drivers/crypto/inside-secure/safexcel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c
index 86c699c1..bc6c5cb 100644
--- a/drivers/crypto/inside-secure/safexcel.c
+++ b/drivers/crypto/inside-secure/safexcel.c
@@ -1066,7 +1066,7 @@ static int safexcel_probe(struct platform_device *pdev)
priv->ring[i].rdr_req = devm_kcalloc(dev,
EIP197_DEFAULT_RING_SIZE,
- sizeof(priv->ring[i].rdr_req),
+ sizeof(*priv->ring[i].rdr_req),
GFP_KERNEL);
if (!priv->ring[i].rdr_req) {
ret = -ENOMEM;
--
2.7.4
Powered by blists - more mailing lists