]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
staging: ashmem: Fix ASHMEM_PURGE_ALL_CACHES return value
authorJohn Stultz <john.stultz@linaro.org>
Mon, 21 Oct 2013 16:58:07 +0000 (09:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Oct 2013 05:22:39 +0000 (06:22 +0100)
Hopefully this isn't too late for 3.12.

In commit 7dc19d5aff (convert shrinkers to new count/scan API)
the return value to PURGE_ALL_CACHES was dropped, causing -EPERM
to always be returned.

This patch re-adds the ret assignment, setting it to the the
ashmem_shrink_count(), which is the lru_count.

(Sorry this was missed in the review!)

Fixes: 7dc19d5affd7 ("convert shrinkers to new count/scan API")
Cc: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Cc: Glauber Costa <glommer@openvz.org>
Reported-by: YongQin Liu <yongqin.liu@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Cc: stable <stable@kernel.org> # 3.12
Acked-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ashmem.c

index db5325c88f1cb494a08d846e5f9a1d859fad00e4..23948f16701206926ec9a76ce347641316d692c5 100644 (file)
@@ -777,7 +777,7 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                                .gfp_mask = GFP_KERNEL,
                                .nr_to_scan = LONG_MAX,
                        };
-
+                       ret = ashmem_shrink_count(&ashmem_shrinker, &sc);
                        nodes_setall(sc.nodes_to_scan);
                        ashmem_shrink_scan(&ashmem_shrinker, &sc);
                }