umber-kernel/drivers/rapidio
Haoxiang Li e5a732bfe2 rapidio: replace rio_free_net() with kfree() in rio_scan_alloc_net()
[ Upstream commit 666183dcdd9ad3b8156a1df7f204f728f720380f ]

When idtab allocation fails, net is not registered with rio_add_net() yet,
so kfree(net) is sufficient to release the memory.  Set mport->net to NULL
to avoid dangling pointer.

Link: https://lkml.kernel.org/r/20260121013508.195836-1-lihaoxiang@isrc.iscas.ac.cn
Fixes: e6b585ca6e ("rapidio: move net allocation into core code")
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexandre Bounine <alex.bou9@gmail.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-03-04 07:21:20 -05:00
..
devices rapidio: remove some dead defines 2025-05-11 17:54:09 -07:00
switches rapidio: remove not used code about RIO_VID_TUNDRA 2021-12-21 10:22:19 +01:00
Kconfig rapidio: remove choice for enumeration 2024-05-14 23:36:19 +09:00
Makefile
rio-access.c
rio-driver.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
rio-scan.c rapidio: replace rio_free_net() with kfree() in rio_scan_alloc_net() 2026-03-04 07:21:20 -05:00
rio-sysfs.c sysfs: treewide: switch back to attribute_group::bin_attrs 2025-06-17 10:44:15 +02:00
rio.c rapidio: remove unused functions 2025-05-11 17:54:09 -07:00
rio.h rapidio: remove unused functions 2025-05-11 17:54:09 -07:00
rio_cm.c drivers/rapidio/rio_cm.c: prevent possible heap overwrite 2025-06-11 22:42:36 -07:00