[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180810230611.2114-1-kys@linuxonhyperv.com>
Date: Fri, 10 Aug 2018 23:06:07 +0000
From: kys@...uxonhyperv.com
To: gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
devel@...uxdriverproject.org, olaf@...fle.de, apw@...onical.com,
jasowang@...hat.com, sthemmin@...rosoft.com,
Michael.H.Kelley@...rosoft.com, vkuznets@...hat.com
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>, stable@...r.kernel.org
Subject: [PATCH 1/5] Tools: hv: Fix a bug in the key delete code
From: "K. Y. Srinivasan" <kys@...rosoft.com>
Fix a bug in the key delete code - the num_records range
from 0 to num_records-1.
Signed-off-by: K. Y. Srinivasan <kys@...rosoft.com>
Reported-by: David Binderman <dcb314@...mail.com>
Cc: <stable@...r.kernel.org>
---
tools/hv/hv_kvp_daemon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index dbf6e8bd98ba..bbb2a8ef367c 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -286,7 +286,7 @@ static int kvp_key_delete(int pool, const __u8 *key, int key_size)
* Found a match; just move the remaining
* entries up.
*/
- if (i == num_records) {
+ if (i == (num_records - 1)) {
kvp_file_info[pool].num_records--;
kvp_update_file(pool);
return 0;
--
2.18.0
Powered by blists - more mailing lists