LKML Archive on
help / color / mirror / Atom feed
* [PATCH] interconnect: Fix undersized devress_alloc allocation
@ 2021-07-30  7:54 Colin King
  0 siblings, 0 replies; only message in thread
From: Colin King @ 2021-07-30  7:54 UTC (permalink / raw)
  To: Georgi Djakov, Akash Asthana, Bjorn Andersson, linux-pm
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <>

The expression sizeof(**ptr) for the void **ptr is just 1 rather than
the size of a pointer. Fix this by using sizeof(*ptr).

Addresses-Coverity: ("Wrong sizeof argument")
Fixes: e145d9a184f2 ("interconnect: Add devm_of_icc_get() as exported API for users")
Signed-off-by: Colin Ian King <>
 drivers/interconnect/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index 55aa8d108c6d..9050ca1f4285 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -403,7 +403,7 @@ struct icc_path *devm_of_icc_get(struct device *dev, const char *name)
 	struct icc_path **ptr, *path;
-	ptr = devres_alloc(devm_icc_release, sizeof(**ptr), GFP_KERNEL);
+	ptr = devres_alloc(devm_icc_release, sizeof(*ptr), GFP_KERNEL);
 	if (!ptr)
 		return ERR_PTR(-ENOMEM);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-30  7:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30  7:54 [PATCH] interconnect: Fix undersized devress_alloc allocation Colin King

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).