kernel_optimize_test/net/smc
Julian Wiedmann 8b2cdc004d net/smc: remove device from smcd_dev_list after failed device_add()
[ Upstream commit 444d7be9532dcfda8e0385226c862fd7e986f607 ]

If the device_add() for a smcd_dev fails, there's no cleanup step that
rolls back the earlier list_add(). The device subsequently gets freed,
and we end up with a corrupted list.

Add some error handling that removes the device from the list.

Fixes: c6ba7c9ba4 ("net/smc: add base infrastructure for SMC-D and ISM")
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-03 09:00:48 +02:00
..
af_smc.c smc: disallow TCP_ULP in smc_setsockopt() 2021-05-19 10:13:08 +02:00
Kconfig
Makefile
smc_cdc.c net/smc: use separate work queues for different worker types 2020-09-10 15:24:27 -07:00
smc_cdc.h
smc_clc.c net/smc: CLC decline - V2 enhancements 2020-09-28 15:19:03 -07:00
smc_clc.h net/smc: Replace zero-length array with flexible-array member 2020-10-30 16:57:42 -05:00
smc_close.c net/smc: check variable before dereferencing in smc_close.c 2020-09-16 17:30:16 -07:00
smc_close.h
smc_core.c net/smc: fix matching of existing link groups 2020-11-19 10:59:19 -08:00
smc_core.h net/smc: introduce CLC first contact extension 2020-09-28 15:19:03 -07:00
smc_diag.c net/smc: use the retry mechanism for netlink messages 2020-09-10 15:24:27 -07:00
smc_ib.c net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid() 2020-11-19 10:59:19 -08:00
smc_ib.h
smc_ism.c net/smc: remove device from smcd_dev_list after failed device_add() 2021-06-03 09:00:48 +02:00
smc_ism.h net/smc: introduce CHID callback for ISM devices 2020-09-28 15:19:03 -07:00
smc_llc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-15 12:43:21 -07:00
smc_llc.h
smc_netns.h net/smc: introduce list of pnetids for Ethernet devices 2020-09-28 15:19:03 -07:00
smc_pnet.c net/smc: determine proposed ISM devices 2020-09-28 15:19:03 -07:00
smc_pnet.h net/smc: determine proposed ISM devices 2020-09-28 15:19:03 -07:00
smc_rx.c
smc_rx.h
smc_tx.c net/smc: use separate work queues for different worker types 2020-09-10 15:24:27 -07:00
smc_tx.h
smc_wr.c
smc_wr.h
smc.h net/smc: introduce CLC first contact extension 2020-09-28 15:19:03 -07:00