aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/amd_energy.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2021-01-19 10:55:19 -0400
committerJason Gunthorpe <jgg@nvidia.com>2021-01-19 10:55:19 -0400
commit02487bcc84cdec676b667096f896ba8ad254aae9 (patch)
treedf66e03b2c63f3488326357882f84b16ed532e1b /drivers/hwmon/amd_energy.c
parentIB/isert: Simplify signature cap check (diff)
parentRDMA/mlx5: Use strict get/set operations for obj_id (diff)
downloadlinux-dev-02487bcc84cdec676b667096f896ba8ad254aae9.tar.xz
linux-dev-02487bcc84cdec676b667096f896ba8ad254aae9.zip
Merge branch 'devx_set_get' into rdma.git for-next
Leon Romanovsky says: ==================== Be more strict with DEVX get/set operations for the obj_id. ==================== Based on the mlx5-next branch at git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux due to dependencies. * branch 'devx_set_get': RDMA/mlx5: Use strict get/set operations for obj_id RDMA/mlx5: Use the correct obj_id upon DEVX TIR creation net/mlx5: Expose ifc bits for query modify header
Diffstat (limited to 'drivers/hwmon/amd_energy.c')
-rw-r--r--drivers/hwmon/amd_energy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hwmon/amd_energy.c b/drivers/hwmon/amd_energy.c
index 9b306448b7a0..822c2e74b98d 100644
--- a/drivers/hwmon/amd_energy.c
+++ b/drivers/hwmon/amd_energy.c
@@ -222,7 +222,7 @@ static int amd_create_sensor(struct device *dev,
*/
cpus = num_present_cpus() / num_siblings;
- s_config = devm_kcalloc(dev, cpus + sockets,
+ s_config = devm_kcalloc(dev, cpus + sockets + 1,
sizeof(u32), GFP_KERNEL);
if (!s_config)
return -ENOMEM;
@@ -254,6 +254,7 @@ static int amd_create_sensor(struct device *dev,
scnprintf(label_l[i], 10, "Esocket%u", (i - cpus));
}
+ s_config[i] = 0;
return 0;
}