From 05b6d7a9700b49662d5d6ed8d49c467e4193c2af Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Tue, 13 Feb 2024 07:19:36 -0500 Subject: [PATCH] Fixes for 5.10 Signed-off-by: Sasha Levin --- ...v-clean-up-a-try_then_request_module.patch | 72 +++++++++++++++++++ queue-5.10/series | 1 + 2 files changed, 73 insertions(+) create mode 100644 queue-5.10/net-af_iucv-clean-up-a-try_then_request_module.patch diff --git a/queue-5.10/net-af_iucv-clean-up-a-try_then_request_module.patch b/queue-5.10/net-af_iucv-clean-up-a-try_then_request_module.patch new file mode 100644 index 00000000000..8f06dc8161e --- /dev/null +++ b/queue-5.10/net-af_iucv-clean-up-a-try_then_request_module.patch @@ -0,0 +1,72 @@ +From 943ef15c60b09c957c7e4628fd31660215836f29 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 9 Aug 2021 10:30:47 +0200 +Subject: net/af_iucv: clean up a try_then_request_module() + +From: Julian Wiedmann + +[ Upstream commit 4eb9eda6ba64114d98827e2870e024d5ab7cd35b ] + +Use IS_ENABLED(CONFIG_IUCV) to determine whether the iucv_if symbol +is available, and let depmod deal with the module dependency. + +This was introduced back with commit 6fcd61f7bf5d ("af_iucv: use +loadable iucv interface"). And to avoid sprinkling IS_ENABLED() over +all the code, we're keeping the indirection through pr_iucv->...(). + +Signed-off-by: Julian Wiedmann +Signed-off-by: Karsten Graul +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/iucv/af_iucv.c | 14 +++----------- + 1 file changed, 3 insertions(+), 11 deletions(-) + +diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c +index e14368ced21f..7c73faa5336c 100644 +--- a/net/iucv/af_iucv.c ++++ b/net/iucv/af_iucv.c +@@ -2310,7 +2310,7 @@ static int __init afiucv_init(void) + { + int err; + +- if (MACHINE_IS_VM) { ++ if (MACHINE_IS_VM && IS_ENABLED(CONFIG_IUCV)) { + cpcmd("QUERY USERID", iucv_userid, sizeof(iucv_userid), &err); + if (unlikely(err)) { + WARN_ON(err); +@@ -2318,11 +2318,7 @@ static int __init afiucv_init(void) + goto out; + } + +- pr_iucv = try_then_request_module(symbol_get(iucv_if), "iucv"); +- if (!pr_iucv) { +- printk(KERN_WARNING "iucv_if lookup failed\n"); +- memset(&iucv_userid, 0, sizeof(iucv_userid)); +- } ++ pr_iucv = &iucv_if; + } else { + memset(&iucv_userid, 0, sizeof(iucv_userid)); + pr_iucv = NULL; +@@ -2356,17 +2352,13 @@ static int __init afiucv_init(void) + out_proto: + proto_unregister(&iucv_proto); + out: +- if (pr_iucv) +- symbol_put(iucv_if); + return err; + } + + static void __exit afiucv_exit(void) + { +- if (pr_iucv) { ++ if (pr_iucv) + afiucv_iucv_exit(); +- symbol_put(iucv_if); +- } + + unregister_netdevice_notifier(&afiucv_netdev_notifier); + dev_remove_pack(&iucv_packet_type); +-- +2.43.0 + diff --git a/queue-5.10/series b/queue-5.10/series index c204f0ddf6a..011c39fef37 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -272,3 +272,4 @@ netfilter-nft_set_pipapo-add-helper-to-release-pcpu-.patch netfilter-nft_set_pipapo-remove-scratch_aligned-poin.patch scsi-core-move-scsi_host_busy-out-of-host-lock-if-it.patch blk-iocost-fix-an-ubsan-shift-out-of-bounds-warning.patch +net-af_iucv-clean-up-a-try_then_request_module.patch -- 2.47.3