linux/drivers/s390
Julian Ruess 0505ff2936 s390/ism: add release function for struct device
[ Upstream commit 915e34d5ad ]

According to device_release() in /drivers/base/core.c,
a device without a release function is a broken device
and must be fixed.

The current code directly frees the device after calling device_add()
without waiting for other kernel parts to release their references.
Thus, a reference could still be held to a struct device,
e.g., by sysfs, leading to potential use-after-free
issues if a proper release function is not set.

Fixes: 8c81ba2034 ("net/smc: De-tangle ism and smc device initialization")
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
Signed-off-by: Julian Ruess <julianr@linux.ibm.com>
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250214120137.563409-1-wintera@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-02-27 04:30:17 -08:00
..
block s390/dasd: fix error recovery leading to data corruption on ESE devices 2024-08-12 10:31:08 -06:00
char s390/sclp: Initialize sclp subsystem via arch_cpu_finalize_init() 2025-02-08 09:58:07 +01:00
cio s390/cio: Do not unregister the subchannel based on DNV 2024-12-05 14:01:11 +01:00
crypto s390/pkey_pckmo: Return with success for valid protected key types 2024-10-16 11:32:32 +02:00
net s390/ism: add release function for struct device 2025-02-27 04:30:17 -08:00
scsi s390/zfcp: use new address translation helpers 2024-03-13 09:23:48 +01:00
virtio s390/virtio_ccw: Fix dma_parm pointer not set up 2024-12-05 14:01:10 +01:00
Makefile s390: remove pointless drivers-y in drivers/s390/Makefile 2019-09-16 13:21:51 +02:00