summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatolii Nikulin <nikulin.a@samsung.com>2015-09-29 16:23:05 +0300
committerDmitry Kovalenko <d.kovalenko@samsung.com>2015-09-29 06:35:09 -0700
commit4e21be1d20b6760949c6d43765c178b063a0bbfc (patch)
treef50645e4d88426b36f0b9c6da857f2b2cab24594
parent35fb7ac0038d8ead47e3184c19cd1a5763c94213 (diff)
downloadswap-modules-4e21be1d20b6760949c6d43765c178b063a0bbfc.tar.gz
swap-modules-4e21be1d20b6760949c6d43765c178b063a0bbfc.tar.bz2
swap-modules-4e21be1d20b6760949c6d43765c178b063a0bbfc.zip
[FIX] error handling for copy from user
swap_msg_flush() should not call if strncpy_from_user() return error Change-Id: I778abaca7078b4594a3bc1364ed3ef181c174648 Signed-off-by: Anatolii Nikulin <nikulin.a@samsung.com>
-rw-r--r--ks_features/ksf_msg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ks_features/ksf_msg.c b/ks_features/ksf_msg.c
index 94d21515..b465359a 100644
--- a/ks_features/ksf_msg.c
+++ b/ks_features/ksf_msg.c
@@ -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);