Patch "net/af_iucv: clean up a try_then_request_module()" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net/af_iucv: clean up a try_then_request_module()

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-af_iucv-clean-up-a-try_then_request_module.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 943ef15c60b09c957c7e4628fd31660215836f29
Author: Julian Wiedmann <jwi@xxxxxxxxxxxxx>
Date:   Mon Aug 9 10:30:47 2021 +0200

    net/af_iucv: clean up a try_then_request_module()
    
    [ 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@xxxxxxxxxxxxx>
    Signed-off-by: Karsten Graul <kgraul@xxxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

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);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux