drivers: lustre: osc: check result of register_shrinker()
authorAliaksei Karaliou <akaraliou.dev@gmail.com>
Thu, 7 Dec 2017 07:25:50 +0000 (10:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2017 11:37:50 +0000 (12:37 +0100)
osc_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>
drivers/staging/lustre/lustre/osc/osc_request.c

index 53eda4c99142b086b5c9c5cf21c504e1d17e6738..45b1ebf33363427aa31904c3707c7780f26b8519 100644 (file)
@@ -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) {