diff options
| author | 2017-12-07 10:25:51 +0300 | |
|---|---|---|
| committer | 2017-12-13 12:37:50 +0100 | |
| commit | 8189c21d7e2d952331d2f0ed75fdfdba871d4be0 (patch) | |
| tree | 83269270c8a948f6c747a81293a82476ace6ec33 | |
| parent | drivers: lustre: osc: check result of register_shrinker() (diff) | |
drivers: lustre: ptlrpc: check result of register_shrinker()
sptlrpc_enc_pool_init() does not check result of register_shrinker()
which was tagged __must_check recently, reported by sparse.
Signed-off-by: Aliaksei Karaliou <akaraliou.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 8 |
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) |
