Commit 85b1ebfe authored by Colin Ian King's avatar Colin Ian King Committed by Georgi Djakov

interconnect: Fix undersized devress_alloc allocation

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: e145d9a1 ("interconnect: Add devm_of_icc_get() as exported API for users")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210730075408.19945-1-colin.king@canonical.comSigned-off-by: default avatarGeorgi Djakov <djakov@kernel.org>
parent f84f5b6f
...@@ -403,7 +403,7 @@ struct icc_path *devm_of_icc_get(struct device *dev, const char *name) ...@@ -403,7 +403,7 @@ struct icc_path *devm_of_icc_get(struct device *dev, const char *name)
{ {
struct icc_path **ptr, *path; 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) if (!ptr)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment