Skip to content

Commit 86503bd

Browse files
kattisrinivasangregkh
authored andcommitted
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>
1 parent c55e931 commit 86503bd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎tools/hv/hv_kvp_daemon.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static int kvp_key_delete(int pool, const __u8 *key, int key_size)
286286
* Found a match; just move the remaining
287287
* entries up.
288288
*/
289-
if (i == num_records) {
289+
if (i == (num_records - 1)) {
290290
kvp_file_info[pool].num_records--;
291291
kvp_update_file(pool);
292292
return 0;

0 commit comments

Comments
 (0)