From 3be21f345e8104899fd1dfcf9347432f5217c481 Mon Sep 17 00:00:00 2001 From: Aliaksei Karaliou Date: Thu, 7 Dec 2017 10:25:50 +0300 Subject: [PATCH] drivers: lustre: osc: check result of register_shrinker() osc_init() does not check result of register_shrinker() which was tagged __must_check recently, reported by sparse. Signed-off-by: Aliaksei Karaliou Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/osc/osc_request.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index 53eda4c99142b..45b1ebf333634 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -2844,7 +2844,9 @@ static int __init osc_init(void) if (rc) goto out_kmem; - register_shrinker(&osc_cache_shrinker); + rc = register_shrinker(&osc_cache_shrinker); + if (rc) + goto out_type; /* This is obviously too much memory, only prevent overflow here */ if (osc_reqpool_mem_max >= 1 << 12 || osc_reqpool_mem_max == 0) { -- 2.30.2