btrfs: fix insert_reserved error handling
[linux-2.6-microblaze.git] / tools / hv / hv_kvp_daemon.c
index dbf6e8b..bbb2a8e 100644 (file)
@@ -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;