lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 20 Apr 2016 15:13:09 -0400
From:	Paul Gortmaker <paul.gortmaker@...driver.com>
To:	<linux-kernel@...r.kernel.org>
CC:	Paul Gortmaker <paul.gortmaker@...driver.com>,
	Christoph Hellwig <hch@....de>,
	Ming Lin <ming.l@....samsung.com>,
	Sagi Grimberg <sagi@...mberg.me>,
	"Martin K . Petersen" <martin.petersen@...cle.com>
Subject: [PATCH] lib: make sg_pool explicitly non-modular

The recently added Kconfig controlling compilation of this code is:

lib/Kconfig:config SG_POOL
lib/Kconfig:    def_bool n

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.  However
one might want to consider moving it to subsys_initcall if it is to
be ready ahead of SCSI drivers wanting this and using device_initcall.

Cc: Christoph Hellwig <hch@....de>
Cc: Ming Lin <ming.l@....samsung.com>
Cc: Sagi Grimberg <sagi@...mberg.me>
Cc: Martin K. Petersen <martin.petersen@...cle.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@...driver.com>
---
 lib/sg_pool.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/lib/sg_pool.c b/lib/sg_pool.c
index 6dd30615a201..e2cf548b9610 100644
--- a/lib/sg_pool.c
+++ b/lib/sg_pool.c
@@ -1,4 +1,4 @@
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/scatterlist.h>
 #include <linux/mempool.h>
 #include <linux/slab.h>
@@ -156,17 +156,4 @@ cleanup_sdb:
 
 	return -ENOMEM;
 }
-
-static __exit void sg_pool_exit(void)
-{
-	int i;
-
-	for (i = 0; i < SG_MEMPOOL_NR; i++) {
-		struct sg_pool *sgp = sg_pools + i;
-		mempool_destroy(sgp->pool);
-		kmem_cache_destroy(sgp->slab);
-	}
-}
-
-module_init(sg_pool_init);
-module_exit(sg_pool_exit);
+device_initcall(sg_pool_init);
-- 
2.8.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ