On Wed, Nov 29, 2017 at 10:33:39PM +0900, Tetsuo Handa wrote:
> 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-ker...@i-love.sakura.ne.jp>
> Cc: John Stultz <john.stu...@linaro.org>
> Cc: Greg Kroah-Hartman <gre...@suse.de>
> Cc: Michal Hocko <mho...@suse.com>
> ---
>  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);

Shouldn't you fail the init function here?

Just reporting the issue isn't going to help anyone.

thanks,

greg k-h
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to