linux/Documentation
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
..
ABI cxl for v6.8 2024-01-18 16:22:43 -08:00
accel accel/qaic: Expand DRM device lifecycle 2023-12-01 10:37:06 -07:00
accounting
admin-guide Various smb client fixes, including multichannel and for SMB3.1.1 POSIX extensions 2024-01-20 16:48:07 -08:00
arch arm64 fixes for -rc1 2024-01-19 13:36:15 -08:00
block Documentation: block: ioprio: Update schedulers 2024-01-18 08:21:14 -07:00
bpf Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
cdrom
core-api A handful of late-arriving documentation fixes. 2024-01-17 11:49:11 -08:00
cpu-freq
crypto Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
dev-tools Kbuild updates for v6.8 2024-01-18 17:57:07 -08:00
devicetree Updates for time and clocksources: 2024-01-21 11:14:40 -08:00
doc-guide docs: Raise the minimum Sphinx requirement to 2.4.4 2023-12-15 08:36:33 -07:00
driver-api pci-v6.8-changes 2024-01-17 16:23:17 -08:00
fault-injection
fb fbdev/intelfb: Remove driver 2024-01-12 12:38:37 +01:00
features riscv: Add support for BATCHED_UNMAP_TLB_FLUSH 2024-01-11 08:01:53 -08:00
filesystems 4 ksmbd server fixes 2024-01-19 09:31:59 -08:00
firmware_class
firmware-guide
fpga
gpu amd-drm-next-6.8-2024-01-05: 2024-01-09 09:07:50 +10:00
hid
hwmon hwmon: (lm75) Add AMS AS6200 temperature sensor 2024-01-02 08:44:57 -08:00
i2c Documentation/i2c: fix spelling error in i2c-address-translators 2023-12-27 20:05:44 +01:00
iio
images
infiniband
input
isdn
kbuild
kernel-hacking
leds
litmus-tests
livepatch
locking locking/mutex: Clarify that mutex_unlock(), and most other sleeping locks, can still use the lock object after it's unlocked 2024-01-08 09:55:31 +01:00
maintainer Documentation: xfs: consolidate XFS docs into its own subdirectory 2023-12-07 14:49:13 +05:30
mhi
misc-devices
mm mm/rmap: rename COMPOUND_MAPPED to ENTIRELY_MAPPED 2023-12-29 11:58:56 -08:00
netlabel
netlink dpll: expose fractional frequency offset value to user 2024-01-05 07:58:19 -08:00
networking Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
nvdimm
nvme
PCI docs: PCI: Fix typos 2023-12-28 17:37:36 -06:00
pcmcia
peci
power Documentation: power: Use kcalloc() instead of kzalloc() 2024-01-23 11:40:42 +05:30
process Kbuild updates for v6.8 2024-01-18 17:57:07 -08:00
RAS Documentation: Begin a RAS section 2023-12-06 21:07:52 +01:00
RCU doc: Mention address and data dependencies in rcu_dereference.rst 2023-12-14 01:16:28 +05:30
rust LoongArch changes for v6.8 2024-01-19 13:30:49 -08:00
scheduler sched/fair: Remove SCHED_FEAT(UTIL_EST_FASTUP, true) 2023-12-23 15:59:56 +01:00
scsi
security Documentation: Destage TEE subsystem documentation 2023-12-08 15:45:10 -07:00
sound
sphinx A handful of late-arriving documentation fixes. 2024-01-17 11:49:11 -08:00
sphinx-static docs: translations: add translations links when they exist 2023-12-19 14:34:59 -07:00
spi spi: pxa2xx: Update DMA mapping and using logic in the documentation 2023-12-08 17:50:00 +00:00
staging rpmsg updates for v6.8 2024-01-17 15:05:27 -08:00
target
tee Documentation: Destage TEE subsystem documentation 2023-12-08 15:45:10 -07:00
timers
tools
trace tracing updates for 6.8: 2024-01-18 14:35:29 -08:00
translations Documentation: power: Use kcalloc() instead of kzalloc() 2024-01-23 11:40:42 +05:30
usb usb: gadget: ncm: Add support to update wMaxSegmentSize via configfs 2024-01-04 16:01:14 +01:00
userspace-api fbdev fixes and cleanups for 6.8-rc1: 2024-01-12 14:38:08 -08:00
virt KVM x86 MMU changes for 6.8: 2024-01-08 08:10:32 -05:00
w1
watchdog
wmi
.gitignore
atomic_bitops.txt
atomic_t.txt
Changes
CodingStyle
conf.py docs: translations: add translations links when they exist 2023-12-19 14:34:59 -07:00
docutils.conf
dontdiff
index.rst Documentation: Begin a RAS section 2023-12-06 21:07:52 +01:00
Kconfig
Makefile doc/netlink: Regenerate netlink .rst files if ynl-gen-rst changes 2023-12-18 14:39:44 -08:00
memory-barriers.txt doc: Clarify historical disclaimers in memory-barriers.txt 2023-12-14 01:16:28 +05:30
SubmittingPatches
subsystem-apis.rst Documentation: Destage TEE subsystem documentation 2023-12-08 15:45:10 -07:00