register_shrinker() might return -ENOMEM error since Linux 3.12. Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> Cc: Robert Love <rlove@xxxxxxxxx> Cc: Marco Nelissen <marcone@xxxxxxxxxxx> Cc: John Stultz <john.stultz@xxxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> --- drivers/staging/android/ashmem.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c index 0f695df..ab56f81 100644 --- a/drivers/staging/android/ashmem.c +++ b/drivers/staging/android/ashmem.c @@ -862,12 +862,18 @@ static int __init ashmem_init(void) goto out_free2; } - register_shrinker(&ashmem_shrinker); + ret = register_shrinker(&ashmem_shrinker); + if (unlikely(ret)) { + pr_err("failed to register shrinker\n"); + goto out_free3; + } pr_info("initialized\n"); return 0; +out_free3: + misc_deregister(&ashmem_misc); out_free2: kmem_cache_destroy(ashmem_range_cachep); out_free1: -- 1.8.3.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel