linux/include
Dan Carpenter 79cbe0be6c mm/slab: make __free(kfree) accept error pointers
commit cd7eb8f83f upstream.

Currently, if an automatically freed allocation is an error pointer that
will lead to a crash.  An example of this is in wm831x_gpio_dbg_show().

   171	char *label __free(kfree) = gpiochip_dup_line_label(chip, i);
   172	if (IS_ERR(label)) {
   173		dev_err(wm831x->dev, "Failed to duplicate label\n");
   174		continue;
   175  }

The auto clean up function should check for error pointers as well,
otherwise we're going to keep hitting issues like this.

Fixes: 54da6a0924 ("locking: Introduce __cleanup() based infrastructure")
Cc: <stable@vger.kernel.org>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-05-17 12:15:01 +02:00
..
acpi ACPI: bus: allow _UID matching for integer zero 2024-04-17 11:23:29 +02:00
asm-generic sched: Add missing memory barrier in switch_mm_cid 2024-04-27 17:13:01 +02:00
clocksource
crypto
drm drm: add drm_gem_object_is_shared_for_memory_stats() helper 2024-05-02 16:35:23 +02:00
dt-bindings clk: renesas: r8a779g0: Correct PFC/GPIO parent clocks 2024-03-26 18:17:05 -04:00
keys
kunit Networking changes for 6.8. 2024-01-11 10:07:29 -08:00
kvm KVM: arm64: Fix host-programmed guest events in nVHE 2024-04-10 16:38:01 +02:00
linux mm/slab: make __free(kfree) accept error pointers 2024-05-17 12:15:01 +02:00
math-emu
media media: mc: Add num_links flag to media_pad 2024-04-03 15:32:03 +02:00
memory
misc
net xfrm: Preserve vlan tags for transport mode software GRO 2024-05-17 12:14:51 +02:00
pcmcia
ras
rdma
rv
scsi scsi: sd: Fix TCG OPAL unlock on system resume 2024-04-03 15:32:45 +02:00
soc soc: qcom: socinfo: rename PM2250 to PM4125 2024-03-26 18:16:34 -04:00
sound ALSA: emu10k1: move the whole GPIO event handling to the workqueue 2024-05-17 12:14:30 +02:00
target
trace rxrpc: Fix the names of the fields in the ACK trailer struct 2024-05-17 12:14:54 +02:00
uapi drm/amdkfd: range check cp bad op exception interrupts 2024-05-17 12:14:39 +02:00
ufs
vdso
video video/sticore: Remove info field from STI struct 2024-01-12 12:38:37 +01:00
xen xen: update PV-device interface headers 2024-01-09 11:46:24 +01:00