Skip to content

Commit 85b1ebf

Browse files
Colin Ian KingGeorgi Djakov
authored andcommitted
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: e145d9a ("interconnect: Add devm_of_icc_get() as exported API for users") Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Georgi Djakov <[email protected]>
1 parent f84f5b6 commit 85b1ebf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/interconnect/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ struct icc_path *devm_of_icc_get(struct device *dev, const char *name)
403403
{
404404
struct icc_path **ptr, *path;
405405

406-
ptr = devres_alloc(devm_icc_release, sizeof(**ptr), GFP_KERNEL);
406+
ptr = devres_alloc(devm_icc_release, sizeof(*ptr), GFP_KERNEL);
407407
if (!ptr)
408408
return ERR_PTR(-ENOMEM);
409409

0 commit comments

Comments
 (0)