From 4e21be1d20b6760949c6d43765c178b063a0bbfc Mon Sep 17 00:00:00 2001 From: Anatolii Nikulin Date: Tue, 29 Sep 2015 16:23:05 +0300 Subject: [PATCH] [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 --- ks_features/ksf_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ks_features/ksf_msg.c b/ks_features/ksf_msg.c index 94d2151..b465359 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); -- 2.7.4