Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 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>

authored by

Colin Ian King and committed by
Georgi Djakov
85b1ebfe f84f5b6f

+1 -1
+1 -1
drivers/interconnect/core.c
··· 403 403 { 404 404 struct icc_path **ptr, *path; 405 405 406 - ptr = devres_alloc(devm_icc_release, sizeof(**ptr), GFP_KERNEL); 406 + ptr = devres_alloc(devm_icc_release, sizeof(*ptr), GFP_KERNEL); 407 407 if (!ptr) 408 408 return ERR_PTR(-ENOMEM); 409 409