summaryrefslogtreecommitdiff
path: root/drivers/interconnect
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2021-07-30 10:54:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-12 14:22:18 +0300
commit1a084e78217dcce8bef262980e0659ce52eed5c5 (patch)
tree35dcf9c808a7b50bd72c83cc7866b2621015fa46 /drivers/interconnect
parentdcc23e58511b75d53cc05c2979a2e00ad30e5885 (diff)
downloadlinux-1a084e78217dcce8bef262980e0659ce52eed5c5.tar.xz
interconnect: Fix undersized devress_alloc allocation
commit 85b1ebfea2b0d8797266bcc6f04b6cc87e38290a upstream. 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 <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210730075408.19945-1-colin.king@canonical.com Signed-off-by: Georgi Djakov <djakov@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/interconnect')
-rw-r--r--drivers/interconnect/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index 8a1e70e00876..b73b7106a424 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);