register_shrinker() might return -ENOMEM error since Linux 3.12. But since callers of ion_device_add_heap() are not ready to receive an error and it is not simple enough to fix within this patch, this patch just prints a warning line when register_shrinker() failed. Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> Cc: John Stultz <john.stultz@xxxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> --- drivers/staging/android/ion/ion_heap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c index 91faa7f..56dcbd8 100644 --- a/drivers/staging/android/ion/ion_heap.c +++ b/drivers/staging/android/ion/ion_heap.c @@ -312,5 +312,6 @@ void ion_heap_init_shrinker(struct ion_heap *heap) heap->shrinker.scan_objects = ion_heap_shrink_scan; heap->shrinker.seeks = DEFAULT_SEEKS; heap->shrinker.batch = 0; - register_shrinker(&heap->shrinker); + if (register_shrinker(&heap->shrinker)) + pr_err("Failed to create heap shrinker for %s\n", heap->name); } -- 1.8.3.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel