From: Anatolii Nikulin Date: Tue, 29 Sep 2015 13:23:05 +0000 (+0300) Subject: [FIX] error handling for copy from user X-Git-Tag: accepted/tizen/2.4/mobile/20151029.024950~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F84%2F48784%2F2;p=kernel%2Fswap-modules.git [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 --- 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);