Skip to content

Commit 5e0eb05

Browse files
committed
Merge tag 'icc-5.4-rc5' of https://git.linaro.org/people/georgi.djakov/linux into char-misc-linus
Georgi writes: interconnect fixes for 5.4 Two tiny fixes for the current release: - Fix memory allocation size in a driver. - Add missing mutex. Signed-off-by: Georgi Djakov <[email protected]> * tag 'icc-5.4-rc5' of https://git.linaro.org/people/georgi.djakov/linux: interconnect: Add locking in icc_set_tag() interconnect: qcom: Fix icc_onecell_data allocation
2 parents d6d5df1 + a8dfe19 commit 5e0eb05

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

drivers/interconnect/core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,12 @@ void icc_set_tag(struct icc_path *path, u32 tag)
405405
if (!path)
406406
return;
407407

408+
mutex_lock(&icc_lock);
409+
408410
for (i = 0; i < path->num_nodes; i++)
409411
path->reqs[i].tag = tag;
412+
413+
mutex_unlock(&icc_lock);
410414
}
411415
EXPORT_SYMBOL_GPL(icc_set_tag);
412416

drivers/interconnect/qcom/qcs404.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ static int qnoc_probe(struct platform_device *pdev)
433433
if (!qp)
434434
return -ENOMEM;
435435

436-
data = devm_kcalloc(dev, num_nodes, sizeof(*node), GFP_KERNEL);
436+
data = devm_kzalloc(dev, struct_size(data, nodes, num_nodes),
437+
GFP_KERNEL);
437438
if (!data)
438439
return -ENOMEM;
439440

drivers/interconnect/qcom/sdm845.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,8 @@ static int qnoc_probe(struct platform_device *pdev)
790790
if (!qp)
791791
return -ENOMEM;
792792

793-
data = devm_kcalloc(&pdev->dev, num_nodes, sizeof(*node), GFP_KERNEL);
793+
data = devm_kzalloc(&pdev->dev, struct_size(data, nodes, num_nodes),
794+
GFP_KERNEL);
794795
if (!data)
795796
return -ENOMEM;
796797

0 commit comments

Comments
 (0)