summaryrefslogtreecommitdiffstats
path: root/drivers/interconnect
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2023-05-23 13:27:28 +0300
committerGeorgi Djakov <djakov@kernel.org>2023-05-30 01:34:50 +0300
commit0ebee0a6f73e7169fb2ee59587aad2880438485a (patch)
tree0d81343d905e1fb360f74f86761183a571e249e4 /drivers/interconnect
parent130733a10079102a78b51bf19bf4e4fa4d119c67 (diff)
downloadlinux-stable-0ebee0a6f73e7169fb2ee59587aad2880438485a.tar.gz
linux-stable-0ebee0a6f73e7169fb2ee59587aad2880438485a.tar.bz2
linux-stable-0ebee0a6f73e7169fb2ee59587aad2880438485a.zip
interconnect: qcom: rpm: allocate enough data in probe()
This was not allocating enough bytes. There are two issue here. First, there was a typo where it was taking the size of the pointer instead of the size of the struct, "sizeof(qp->intf_clks)" vs "sizeof(*qp->intf_clks)". Second, it's an array of "cd_num" clocks so we need to allocate space for more than one element. Fixes: 2e2113c8a64f ("interconnect: qcom: rpm: Handle interface clocks") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/e0fa275c-ae63-4342-9c9e-0ffaf6314da1@kili.mountain Signed-off-by: Georgi Djakov <djakov@kernel.org>
Diffstat (limited to 'drivers/interconnect')
-rw-r--r--drivers/interconnect/qcom/icc-rpm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c
index f4627c4a1bdd..6acc7686ed38 100644
--- a/drivers/interconnect/qcom/icc-rpm.c
+++ b/drivers/interconnect/qcom/icc-rpm.c
@@ -436,7 +436,7 @@ int qnoc_probe(struct platform_device *pdev)
if (!qp)
return -ENOMEM;
- qp->intf_clks = devm_kzalloc(dev, sizeof(qp->intf_clks), GFP_KERNEL);
+ qp->intf_clks = devm_kcalloc(dev, cd_num, sizeof(*qp->intf_clks), GFP_KERNEL);
if (!qp->intf_clks)
return -ENOMEM;