diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2018-08-11 02:06:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-26 09:38:06 +0300 |
commit | 47358b34baa7deacaecda8b2d6196a72d5d54874 (patch) | |
tree | 0cf3ad5d03f774cddcd82df7fd26fe8d74592cf4 | |
parent | 888e989a753a076d8323fd0c353c0bfcf016f9e8 (diff) | |
download | linux-47358b34baa7deacaecda8b2d6196a72d5d54874.tar.xz |
Tools: hv: Fix a bug in the key delete code
commit 86503bd35dec0ce363e9fdbf5299927422ed3899 upstream.
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>
-rw-r--r-- | tools/hv/hv_kvp_daemon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c index 4c99c57736ce..3965186b375a 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; |