aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c')
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c
index 77a3721beaee..134ee727e8b7 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c
@@ -396,6 +396,8 @@ static struct shrinker pools_shrinker = {
int sptlrpc_enc_pool_init(void)
{
+ int rc;
+
/*
* maximum capacity is 1/8 of total physical memory.
* is the 1/8 a good number?
@@ -432,9 +434,11 @@ int sptlrpc_enc_pool_init(void)
if (!page_pools.epp_pools)
return -ENOMEM;
- register_shrinker(&pools_shrinker);
+ rc = register_shrinker(&pools_shrinker);
+ if (rc)
+ enc_pools_free();
- return 0;
+ return rc;
}
void sptlrpc_enc_pool_fini(void)