aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAliaksei Karaliou <[email protected]>2017-12-07 10:25:50 +0300
committerGreg Kroah-Hartman <[email protected]>2017-12-13 12:37:50 +0100
commit3be21f345e8104899fd1dfcf9347432f5217c481 (patch)
treecaf37e0b29236f17fc3753314fd14217270689b4
parent7c7da1af05becae4a524fe9a978b5f4f50bfabad (diff)
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/staging/lustre/lustre/osc/osc_request.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c
index 53eda4c99142..45b1ebf33363 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) {