ks_feature: fix memory allocation size 01/111101/3
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 13 Oct 2016 17:07:48 +0000 (20:07 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 30 Jan 2017 16:39:23 +0000 (19:39 +0300)
Correct memory allocation size for kretprobe pointers array.

Change-Id: Ic5fa0582936a59730cacd2f7fa889927971fbd49
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
ks_features/ks_features.c

index 7957b60..14aa8d9 100644 (file)
@@ -294,9 +294,8 @@ static int unregister_multiple_syscalls(size_t *id_p, size_t cnt)
        if (cnt == 1)
                return unregister_syscall(id_p[0]);
 
-       --cnt;
-
        rpp = kmalloc(GFP_KERNEL, sizeof(*rpp) * cnt);
+       --cnt;
        if (rpp == NULL) {
                for (; cnt != end; --cnt) {
                        ret = unregister_syscall(id_p[cnt]);