mirror-linux/include
Malaya Kumar Rout b57100a3d9 PM: console: Fix memory allocation error handling in pm_vt_switch_required()
The pm_vt_switch_required() function fails silently when memory
allocation fails, offering no indication to callers that the operation
was unsuccessful. This behavior prevents drivers from handling allocation
errors correctly or implementing retry mechanisms. By ensuring that
failures are reported back to the caller, drivers can make informed
decisions, improve robustness, and avoid unexpected behavior during
critical power management operations.

Change the function signature to return an integer error code and modify
the implementation to return -ENOMEM when kmalloc() fails. Update both
the function declaration and the inline stub in include/linux/pm.h to
maintain consistency across CONFIG_VT_CONSOLE_SLEEP configurations.

The function now returns:
 - 0 on success (including when updating existing entries)
 - -ENOMEM when memory allocation fails

This change improves error reporting without breaking existing callers,
as the current callers in drivers/video/fbdev/core/fbmem.c already
ignore the return value, making this a backward-compatible improvement.

Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Malaya Kumar Rout <mrout@redhat.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://patch.msgid.link/20251013193028.89570-1-mrout@redhat.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2025-10-18 14:38:23 +02:00
..
acpi More power management updates for 6.18-rc1 2025-10-07 09:39:51 -07:00
asm-generic hyperv-next for v6.18 2025-10-07 08:40:15 -07:00
clocksource
crypto This update includes the following changes: 2025-10-04 14:59:29 -07:00
cxl
drm drm/gpusvm, drm/xe: Fix userptr to not allow device private pages 2025-10-02 21:57:52 -07:00
dt-bindings There's a bunch of patches here across drivers/clk/ to migrate drivers to use 2025-10-07 09:28:37 -07:00
hyperv hyperv: Remove the spurious null directive line 2025-10-02 21:21:24 +00:00
keys
kunit linux_kselftest-kunit-6.18-rc1 2025-10-01 19:15:11 -07:00
kvm KVM/arm64 updates for 6.18 2025-09-30 13:23:28 -04:00
linux PM: console: Fix memory allocation error handling in pm_vt_switch_required() 2025-10-18 14:38:23 +02:00
math-emu
media
memory
misc
net net: psp: don't assume reply skbs will have a socket 2025-10-03 10:23:50 -07:00
pcmcia
ras
rdma
rv kernel-6.18-rc1.clone3 2025-09-29 10:36:50 -07:00
scsi SCSI misc on 20251002 2025-10-03 19:17:48 -07:00
soc There's a bunch of patches here across drivers/clk/ to migrate drivers to use 2025-10-07 09:28:37 -07:00
sound
target
trace dma-mapping fixes for Linux 6.18: 2025-10-07 12:48:06 -07:00
uapi bpf-fixes 2025-10-11 10:31:38 -07:00
ufs scsi: ufs: core: Include UTP error in INT_FATAL_ERRORS 2025-09-30 16:10:29 -04:00
vdso Updates for the VDSO subsystem: 2025-09-30 16:58:21 -07:00
video
xen
Kbuild