Skip to content

Commit 0ebee0a

Browse files
Dan CarpenterGeorgi Djakov
authored andcommitted
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: 2e2113c ("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>
1 parent 130733a commit 0ebee0a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/interconnect/qcom/icc-rpm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ int qnoc_probe(struct platform_device *pdev)
436436
if (!qp)
437437
return -ENOMEM;
438438

439-
qp->intf_clks = devm_kzalloc(dev, sizeof(qp->intf_clks), GFP_KERNEL);
439+
qp->intf_clks = devm_kcalloc(dev, cd_num, sizeof(*qp->intf_clks), GFP_KERNEL);
440440
if (!qp->intf_clks)
441441
return -ENOMEM;
442442

0 commit comments

Comments
 (0)