[FIX] error handling for copy from user 84/48784/2
authorAnatolii Nikulin <nikulin.a@samsung.com>
Tue, 29 Sep 2015 13:23:05 +0000 (16:23 +0300)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Tue, 29 Sep 2015 13:35:09 +0000 (06:35 -0700)
swap_msg_flush() should not call if strncpy_from_user() return error

Change-Id: I778abaca7078b4594a3bc1364ed3ef181c174648
Signed-off-by: Anatolii Nikulin <nikulin.a@samsung.com>
ks_features/ksf_msg.c

index 94d2151..b465359 100644 (file)
@@ -240,7 +240,7 @@ void ksf_msg_file_entry_open(int fd, enum file_api_t api, const char *path,
        n = strncpy_from_user(p, ofile, size);
        if (n < 0) {
                printk(KSF_PREFIX "cannot copy ofile\n");
-               swap_msg_put(m);
+               goto put_msg;
        }
 
        swap_msg_flush(m, ret + n + 1);