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>
This commit is contained in:
Aliaksei Karaliou
2017-12-07 10:25:51 +03:00
committed by Greg Kroah-Hartman
parent 3be21f345e
commit 8189c21d7e

View File

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