Skip to content

Commit fbad4a4

Browse files
kattisrinivasanmerwick
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 <[email protected]> Reported-by: David Binderman <[email protected]> Cc: <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 86503bd) Orabug: 28671425 Signed-off-by: Liam Merwick <[email protected]> Reviewed-by: Darren Kenny <[email protected]> Reviewed-by: Alejandro Jimenez <[email protected]> Tested-by: Vijay Balakrishna <[email protected]>
1 parent 4cb03e3 commit fbad4a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)