mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 23:09:29 +02:00
Merge branch 'icc-misc' into icc-next
* icc-misc interconnect: qcom: add COMPILE_TEST interconnect: qcom: simplify allocation interconnect: debugfs-client: add NULL check for platform_device_alloc interconnect: Fix use after free in icc_get() and of_icc_get_by_index() Signed-off-by: Georgi Djakov <djakov@kernel.org>
This commit is contained in:
@@ -548,7 +548,7 @@ struct icc_path *of_icc_get_by_index(struct device *dev, int idx)
|
||||
path->name = kasprintf(GFP_KERNEL, "%s-%s",
|
||||
src_data->node->name, dst_data->node->name);
|
||||
if (!path->name) {
|
||||
kfree(path);
|
||||
icc_put(path);
|
||||
path = ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
@@ -646,8 +646,9 @@ struct icc_path *icc_get(struct device *dev, const char *src, const char *dst)
|
||||
|
||||
path->name = kasprintf(GFP_KERNEL, "%s-%s", src_node->name, dst_node->name);
|
||||
if (!path->name) {
|
||||
kfree(path);
|
||||
path = ERR_PTR(-ENOMEM);
|
||||
mutex_unlock(&icc_lock);
|
||||
icc_put(path);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
out:
|
||||
mutex_unlock(&icc_lock);
|
||||
|
||||
@@ -142,6 +142,8 @@ int icc_debugfs_client_init(struct dentry *icc_dir)
|
||||
int ret;
|
||||
|
||||
pdev = platform_device_alloc("icc-debugfs-client", PLATFORM_DEVID_NONE);
|
||||
if (!pdev)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = platform_device_add(pdev);
|
||||
if (ret) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
config INTERCONNECT_QCOM
|
||||
tristate "Qualcomm Network-on-Chip interconnect drivers"
|
||||
depends on ARCH_QCOM
|
||||
depends on ARCH_QCOM || COMPILE_TEST
|
||||
help
|
||||
Support for Qualcomm's Network-on-Chip interconnect hardware.
|
||||
|
||||
|
||||
@@ -479,13 +479,11 @@ int qnoc_probe(struct platform_device *pdev)
|
||||
cd_num = 0;
|
||||
}
|
||||
|
||||
qp = devm_kzalloc(dev, sizeof(*qp), GFP_KERNEL);
|
||||
qp = devm_kzalloc(dev, struct_size(qp, intf_clks, cd_num), GFP_KERNEL);
|
||||
if (!qp)
|
||||
return -ENOMEM;
|
||||
|
||||
qp->intf_clks = devm_kcalloc(dev, cd_num, sizeof(*qp->intf_clks), GFP_KERNEL);
|
||||
if (!qp->intf_clks)
|
||||
return -ENOMEM;
|
||||
qp->num_intf_clks = cd_num;
|
||||
|
||||
if (desc->bus_clk_desc) {
|
||||
qp->bus_clk_desc = devm_kzalloc(dev, sizeof(*qp->bus_clk_desc),
|
||||
@@ -507,7 +505,6 @@ int qnoc_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
data->num_nodes = num_nodes;
|
||||
|
||||
qp->num_intf_clks = cd_num;
|
||||
for (i = 0; i < cd_num; i++)
|
||||
qp->intf_clks[i].id = cds[i];
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ struct rpm_clk_resource {
|
||||
/**
|
||||
* struct qcom_icc_provider - Qualcomm specific interconnect provider
|
||||
* @provider: generic interconnect provider
|
||||
* @num_intf_clks: the total number of intf_clks clk_bulk_data entries
|
||||
* @type: the ICC provider type
|
||||
* @regmap: regmap for QoS registers read/write access
|
||||
* @qos_offset: offset to QoS registers
|
||||
@@ -49,13 +48,13 @@ struct rpm_clk_resource {
|
||||
* @bus_clk_rate: bus clock rate in Hz
|
||||
* @bus_clk_desc: a pointer to a rpm_clk_resource description of bus clocks
|
||||
* @bus_clk: a pointer to a HLOS-owned bus clock
|
||||
* @intf_clks: a clk_bulk_data array of interface clocks
|
||||
* @keep_alive: whether to always keep a minimum vote on the bus clocks
|
||||
* @ignore_enxio: whether to ignore ENXIO errors (for MSM8974)
|
||||
* @num_intf_clks: the total number of intf_clks clk_bulk_data entries
|
||||
* @intf_clks: a clk_bulk_data array of interface clocks
|
||||
*/
|
||||
struct qcom_icc_provider {
|
||||
struct icc_provider provider;
|
||||
int num_intf_clks;
|
||||
enum qcom_icc_type type;
|
||||
struct regmap *regmap;
|
||||
unsigned int qos_offset;
|
||||
@@ -64,9 +63,10 @@ struct qcom_icc_provider {
|
||||
u32 bus_clk_rate[QCOM_SMD_RPM_STATE_NUM];
|
||||
const struct rpm_clk_resource *bus_clk_desc;
|
||||
struct clk *bus_clk;
|
||||
struct clk_bulk_data *intf_clks;
|
||||
bool keep_alive;
|
||||
bool ignore_enxio;
|
||||
int num_intf_clks;
|
||||
struct clk_bulk_data intf_clks[] __counted_by(num_intf_clks);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user