diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2017-11-29 08:29:47 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-18 09:59:17 -0500 |
commit | 533dfb250d1c8d2bb8c9b65252f7b296b29913d4 (patch) | |
tree | 3e18255457cf2d693e5f984dcb0ebdeb3c79892b /drivers/android/binder_alloc.c | |
parent | 22ec1a2aea73b9dfe340dff7945bd85af4cc6280 (diff) |
android: binder: Check for errors in binder_alloc_shrinker_init().
Both list_lru_init() and register_shrinker() might return an error.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Sherry Yang <sherryy@android.com>
Cc: Michal Hocko <mhocko@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android/binder_alloc.c')
-rw-r--r-- | drivers/android/binder_alloc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 0dba2308125c..fdf9d9f12aac 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c | |||
@@ -1006,8 +1006,14 @@ void binder_alloc_init(struct binder_alloc *alloc) | |||
1006 | INIT_LIST_HEAD(&alloc->buffers); | 1006 | INIT_LIST_HEAD(&alloc->buffers); |
1007 | } | 1007 | } |
1008 | 1008 | ||
1009 | void binder_alloc_shrinker_init(void) | 1009 | int binder_alloc_shrinker_init(void) |
1010 | { | 1010 | { |
1011 | list_lru_init(&binder_alloc_lru); | 1011 | int ret = list_lru_init(&binder_alloc_lru); |
1012 | register_shrinker(&binder_shrinker); | 1012 | |
1013 | if (ret == 0) { | ||
1014 | ret = register_shrinker(&binder_shrinker); | ||
1015 | if (ret) | ||
1016 | list_lru_destroy(&binder_alloc_lru); | ||
1017 | } | ||
1018 | return ret; | ||
1013 | } | 1019 | } |