linux-next/Documentation/power
Erick Archer 9ac3ebaef3 Documentation: power: Use kcalloc() instead of kzalloc()
As noted in the "Deprecated Interfaces, Language Features, Attributes,
and Conventions" documentation [1], size calculations (especially
multiplication) should not be performed in memory allocator (or similar)
function arguments due to the risk of them overflowing. This could lead
to values wrapping around and a smaller allocation being made than the
caller was expecting. Using those allocations could lead to linear
overflows of heap memory and other misbehaviors.

So, in the example code use the purpose specific kcalloc() function
instead of the argument size * count in the kzalloc() function.

At the same time, modify the translations accordingly.

Signed-off-by: Erick Archer <erick.archer@gmx.com>
Reviewed-by: Hu Haowen <2023002089@link.tyut.edu.cn>
Reviewed-by: Yanteng Si <siyanteng@loongson.cn>
Reviewed-by: Hu Haowen <2023002089@link.tyut.edu.cn>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2024-01-23 11:40:42 +05:30
..
powercap Documentation/powercap/dtpm: Add documentation for dtpm 2020-12-22 19:50:40 +01:00
regulator regulator: consumer.rst: fix 'regulator_enable' typo. 2023-04-27 21:55:38 +01:00
apm-acpi.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
basic-pm-debugging.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
charger-manager.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
drivers-testing.rst PM: Wrap documentation to fit in 80 columns 2019-11-20 12:16:37 +01:00
energy-model.rst Documentation: Fix typos 2023-08-18 11:29:03 -06:00
freezing-of-tasks.rst Documentation: PM: Adjust freezing-of-tasks.rst to the freezer changes 2023-12-19 21:14:32 +01:00
index.rst Documentation/powercap/dtpm: Add documentation for dtpm 2020-12-22 19:50:40 +01:00
opp.rst Documentation: power: Use kcalloc() instead of kzalloc() 2024-01-23 11:40:42 +05:30
pci.rst Documentation: PM: Drop pme_interrupt reference 2022-07-08 21:26:09 +02:00
pm_qos_interface.rst Documentation: power: fix pm_qos_interface.rst format warning 2020-02-20 11:53:32 +01:00
power_supply_class.rst power: remove pda_power supply driver 2023-02-01 17:23:38 +01:00
runtime_pm.rst PM: runtime: Capture device status before disabling runtime PM 2021-12-17 16:16:40 +01:00
s2ram.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
suspend-and-cpuhotplug.rst cpu/hotplug: Remove disable_nonboot_cpus() 2020-05-07 15:18:40 +02:00
suspend-and-interrupts.rst Documentation: power: correct spelling 2023-01-30 19:13:20 +01:00
swsusp-and-swap-files.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
swsusp-dmcrypt.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
swsusp.rst PM: Wrap documentation to fit in 80 columns 2019-11-20 12:16:37 +01:00
tricks.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00
userland-swsusp.rst PM: hibernate: fix docs for ioctls that return loff_t via pointer 2020-03-14 11:51:32 +01:00
video.rst docs: power: convert docs to ReST and rename to *.rst 2019-06-14 16:08:36 -05:00