diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 86cd1ea355792148dcda2d48f9554ca7edeb99f2..2c6286c0bc1ac70ef190bdbd031905593070c933 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -830,7 +830,8 @@ static int handle_exit(void)
 		fprintf(stderr, _("\n\n"
 				  "Your configuration changes were NOT saved."
 				  "\n\n"));
-		res = 0;
+		if (res != KEY_ESC)
+			res = 0;
 	}
 
 	return res;