linux/drivers/char/xilinx_hwicap
Myeonghun Pak e7e12b4cc0 char: xilinx_hwicap: unregister class on init errors
hwicap_module_init() registers icap_class before reserving the
character-device region and registering the platform driver.  If either
of those later steps fails, the init path must undo the successful class
registration before returning an error.

Route the chrdev registration failure through a class unwind label, and
let the platform-driver registration failure fall through the existing
chrdev unwind before unregistering the class.  The normal module exit path
is unchanged.

This issue was identified during our ongoing static-analysis research while
reviewing kernel code.

Fixes: ef141a0bb0 ("[POWERPC] Xilinx: hwicap driver")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Link: https://patch.msgid.link/20260623085604.89284-1-mhun512@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-17 16:22:57 +02:00
..
buffer_icap.c
buffer_icap.h
fifo_icap.c xilinx_hwicap: fifo_icap.c: fix all kernel-doc warnings 2026-01-16 16:36:04 +01:00
fifo_icap.h
Makefile
xilinx_hwicap.c char: xilinx_hwicap: unregister class on init errors 2026-07-17 16:22:57 +02:00
xilinx_hwicap.h