summaryrefslogtreecommitdiff
path: root/tools/hv
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2018-08-10 23:06:07 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-12 09:31:00 +0200
commit86503bd35dec0ce363e9fdbf5299927422ed3899 (patch)
tree98ec4bba51d18c3f4fd6558d2f6045c2f70bac49 /tools/hv
parentc55e9318871cd06e4aa10f5023cc2dcdfbb08577 (diff)
downloadlwn-86503bd35dec0ce363e9fdbf5299927422ed3899.tar.gz
lwn-86503bd35dec0ce363e9fdbf5299927422ed3899.zip
Tools: hv: Fix a bug in the key delete code
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@microsoft.com> Reported-by: David Binderman <dcb314@hotmail.com> Cc: <stable@vger.kernel.org> Reviewed-by: Michael Kelley <mikelley@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/hv')
-rw-r--r--tools/hv/hv_kvp_daemon.c2
1 files changed, 1 insertions, 1 deletions
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;