hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/cpufreq/brcmstb-avs-cpufreq.c
....@@ -434,7 +434,11 @@
434434 if (ret)
435435 return ERR_PTR(ret);
436436
437
- table = devm_kcalloc(dev, AVS_PSTATE_MAX + 1, sizeof(*table),
437
+ /*
438
+ * We allocate space for the 5 different P-STATES AVS,
439
+ * plus extra space for a terminating element.
440
+ */
441
+ table = devm_kcalloc(dev, AVS_PSTATE_MAX + 1 + 1, sizeof(*table),
438442 GFP_KERNEL);
439443 if (!table)
440444 return ERR_PTR(-ENOMEM);