diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-02 18:11:40 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-02 18:11:40 +0100 |
commit | 5e0eb05d7f751aa7ebc67fa9fc06a3f020c7b64e (patch) | |
tree | c42c0ca5e02f8acf56330ada1a4967ea889019df | |
parent | d6d5df1db6e9d7f8f76d2911707f7d5877251b02 (diff) | |
parent | a8dfe193a60c6db7c54e03e3f1b96e0aa7244990 (diff) |
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 <georgi.djakov@linaro.org>
* 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
-rw-r--r-- | drivers/interconnect/core.c | 4 | ||||
-rw-r--r-- | drivers/interconnect/qcom/qcs404.c | 3 | ||||
-rw-r--r-- | drivers/interconnect/qcom/sdm845.c | 3 |
3 files changed, 8 insertions, 2 deletions
diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 7b971228df38..c498796adc07 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -405,8 +405,12 @@ void icc_set_tag(struct icc_path *path, u32 tag) if (!path) return; + mutex_lock(&icc_lock); + for (i = 0; i < path->num_nodes; i++) path->reqs[i].tag = tag; + + mutex_unlock(&icc_lock); } EXPORT_SYMBOL_GPL(icc_set_tag); diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c index 910081d6ddc0..b4966d8f3348 100644 --- a/drivers/interconnect/qcom/qcs404.c +++ b/drivers/interconnect/qcom/qcs404.c @@ -433,7 +433,8 @@ static int qnoc_probe(struct platform_device *pdev) if (!qp) return -ENOMEM; - data = devm_kcalloc(dev, num_nodes, sizeof(*node), GFP_KERNEL); + data = devm_kzalloc(dev, struct_size(data, nodes, num_nodes), + GFP_KERNEL); if (!data) return -ENOMEM; diff --git a/drivers/interconnect/qcom/sdm845.c b/drivers/interconnect/qcom/sdm845.c index 57955596bb59..502a6c22b41e 100644 --- a/drivers/interconnect/qcom/sdm845.c +++ b/drivers/interconnect/qcom/sdm845.c @@ -790,7 +790,8 @@ static int qnoc_probe(struct platform_device *pdev) if (!qp) return -ENOMEM; - data = devm_kcalloc(&pdev->dev, num_nodes, sizeof(*node), GFP_KERNEL); + data = devm_kzalloc(&pdev->dev, struct_size(data, nodes, num_nodes), + GFP_KERNEL); if (!data) return -ENOMEM; |