]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.4
authorSasha Levin <sashal@kernel.org>
Tue, 13 Feb 2024 12:19:36 +0000 (07:19 -0500)
committerSasha Levin <sashal@kernel.org>
Tue, 13 Feb 2024 12:19:36 +0000 (07:19 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.4/net-af_iucv-clean-up-a-try_then_request_module.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/net-af_iucv-clean-up-a-try_then_request_module.patch b/queue-5.4/net-af_iucv-clean-up-a-try_then_request_module.patch
new file mode 100644 (file)
index 0000000..a7b63ec
--- /dev/null
@@ -0,0 +1,72 @@
+From b5bb18145139e31f5d06c8956d6b5034221744f8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 9 Aug 2021 10:30:47 +0200
+Subject: net/af_iucv: clean up a try_then_request_module()
+
+From: Julian Wiedmann <jwi@linux.ibm.com>
+
+[ 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 <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>
+---
+ 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 bbc1924d64e5..652285191da1 100644
+--- a/net/iucv/af_iucv.c
++++ b/net/iucv/af_iucv.c
+@@ -2455,7 +2455,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);
+@@ -2463,11 +2463,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;
+@@ -2501,17 +2497,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
+
index 121271f95c79e517cb3b4393c08370b556ff6636..7cc4d54f915c7e4418ddccca9322e6d3baecd8a7 100644 (file)
@@ -192,3 +192,4 @@ ppp_async-limit-mru-to-64k.patch
 netfilter-nft_compat-reject-unused-compat-flag.patch
 netfilter-nft_compat-restrict-match-target-protocol-.patch
 netfilter-nft_ct-reject-direction-for-ct-id.patch
+net-af_iucv-clean-up-a-try_then_request_module.patch