From e54def4ad8144ab15f826416e2e0f290ef1901b4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 19 Jun 2024 23:00:30 +0200 Subject: Adding upstream version 6.9.2. Signed-off-by: Daniel Baumann --- net/qrtr/ns.c | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'net/qrtr/ns.c') diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c index 654a3cc0d3..abb0c70ffc 100644 --- a/net/qrtr/ns.c +++ b/net/qrtr/ns.c @@ -725,24 +725,6 @@ int qrtr_ns_init(void) if (ret < 0) goto err_wq; - /* As the qrtr ns socket owner and creator is the same module, we have - * to decrease the qrtr module reference count to guarantee that it - * remains zero after the ns socket is created, otherwise, executing - * "rmmod" command is unable to make the qrtr module deleted after the - * qrtr module is inserted successfully. - * - * However, the reference count is increased twice in - * sock_create_kern(): one is to increase the reference count of owner - * of qrtr socket's proto_ops struct; another is to increment the - * reference count of owner of qrtr proto struct. Therefore, we must - * decrement the module reference count twice to ensure that it keeps - * zero after server's listening socket is created. Of course, we - * must bump the module reference count twice as well before the socket - * is closed. - */ - module_put(qrtr_ns.sock->ops->owner); - module_put(qrtr_ns.sock->sk->sk_prot_creator->owner); - return 0; err_wq: @@ -757,15 +739,6 @@ void qrtr_ns_remove(void) { cancel_work_sync(&qrtr_ns.work); destroy_workqueue(qrtr_ns.workqueue); - - /* sock_release() expects the two references that were put during - * qrtr_ns_init(). This function is only called during module remove, - * so try_stop_module() has already set the refcnt to 0. Use - * __module_get() instead of try_module_get() to successfully take two - * references. - */ - __module_get(qrtr_ns.sock->ops->owner); - __module_get(qrtr_ns.sock->sk->sk_prot_creator->owner); sock_release(qrtr_ns.sock); } EXPORT_SYMBOL_GPL(qrtr_ns_remove); -- cgit v1.2.3