ks_feature: fix memory corruption 02/111102/3
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 13 Oct 2016 17:15:40 +0000 (20:15 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 30 Jan 2017 16:39:23 +0000 (19:39 +0300)
Change function arguments order.

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

index 14aa8d9..503612f 100644 (file)
@@ -294,7 +294,7 @@ static int unregister_multiple_syscalls(size_t *id_p, size_t cnt)
        if (cnt == 1)
                return unregister_syscall(id_p[0]);
 
-       rpp = kmalloc(GFP_KERNEL, sizeof(*rpp) * cnt);
+       rpp = kmalloc(sizeof(*rpp) * cnt, GFP_KERNEL);
        --cnt;
        if (rpp == NULL) {
                for (; cnt != end; --cnt) {
@@ -337,7 +337,7 @@ static void do_uninstall_features(struct feature *f, size_t i)
        size_t cnt = 0;
        const size_t end = ((size_t) 0) - 1;
 
-       id_p = kmalloc(GFP_KERNEL, sizeof(id) * (i + 1));
+       id_p = kmalloc(sizeof(id) * (i + 1), GFP_KERNEL);
        /* NULL check is below in loop */
 
        for (; i != end; --i) {