* [PATCH] crypto: inside-secure: Fix sizeof() mismatch
@ 2020-10-10 16:47 Colin King
2020-10-11 10:19 ` Antoine Tenart
2020-10-30 6:49 ` Herbert Xu
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2020-10-10 16:47 UTC (permalink / raw)
To: Antoine Tenart, Herbert Xu, David S . Miller, Ofer Heifetz, linux-crypto
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
An incorrect sizeof() is being used, sizeof(priv->ring[i].rdr_req) is
not correct, it should be sizeof(*priv->ring[i].rdr_req). Note that
since the size of ** is the same size as * this is not causing any
issues.
Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)")
Fixes: 9744fec95f06 ("crypto: inside-secure - remove request list to improve performance")
Signed-off-by: Colin Ian King <colin.king@canonical.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 eb2418450f12..2e1562108a85 100644
--- a/drivers/crypto/inside-secure/safexcel.c
+++ b/drivers/crypto/inside-secure/safexcel.c
@@ -1639,7 +1639,7 @@ static int safexcel_probe_generic(void *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)
return -ENOMEM;
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] crypto: inside-secure: Fix sizeof() mismatch
2020-10-10 16:47 [PATCH] crypto: inside-secure: Fix sizeof() mismatch Colin King
@ 2020-10-11 10:19 ` Antoine Tenart
2020-10-30 6:49 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Antoine Tenart @ 2020-10-11 10:19 UTC (permalink / raw)
To: David S . Miller, Colin King, Herbert Xu, Ofer Heifetz, linux-crypto
Cc: kernel-janitors, linux-kernel
Hello,
Quoting Colin King (2020-10-10 18:47:36)
> From: Colin Ian King <colin.king@canonical.com>
>
> An incorrect sizeof() is being used, sizeof(priv->ring[i].rdr_req) is
> not correct, it should be sizeof(*priv->ring[i].rdr_req). Note that
> since the size of ** is the same size as * this is not causing any
> issues.
>
> Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)")
> Fixes: 9744fec95f06 ("crypto: inside-secure - remove request list to improve performance")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Antoine Tenart <atenart@kernel.org>
Thanks!
Antoine
> ---
> 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 eb2418450f12..2e1562108a85 100644
> --- a/drivers/crypto/inside-secure/safexcel.c
> +++ b/drivers/crypto/inside-secure/safexcel.c
> @@ -1639,7 +1639,7 @@ static int safexcel_probe_generic(void *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)
> return -ENOMEM;
> --
> 2.27.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] crypto: inside-secure: Fix sizeof() mismatch
2020-10-10 16:47 [PATCH] crypto: inside-secure: Fix sizeof() mismatch Colin King
2020-10-11 10:19 ` Antoine Tenart
@ 2020-10-30 6:49 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2020-10-30 6:49 UTC (permalink / raw)
To: Colin King
Cc: Antoine Tenart, David S . Miller, Ofer Heifetz, linux-crypto,
kernel-janitors, linux-kernel
On Sat, Oct 10, 2020 at 05:47:36PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> An incorrect sizeof() is being used, sizeof(priv->ring[i].rdr_req) is
> not correct, it should be sizeof(*priv->ring[i].rdr_req). Note that
> since the size of ** is the same size as * this is not causing any
> issues.
>
> Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)")
> Fixes: 9744fec95f06 ("crypto: inside-secure - remove request list to improve performance")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/crypto/inside-secure/safexcel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Patch applied. Thanks.
--
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] 3+ messages in thread
end of thread, other threads:[~2020-10-30 6:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-10 16:47 [PATCH] crypto: inside-secure: Fix sizeof() mismatch Colin King
2020-10-11 10:19 ` Antoine Tenart
2020-10-30 6:49 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).