dm: remove unneeded kvfree from alloc_targets
authorBenjamin Marzinski <bmarzins@redhat.com>
Tue, 15 Apr 2025 04:17:15 +0000 (00:17 -0400)
committerMikulas Patocka <mpatocka@redhat.com>
Sun, 4 May 2025 09:35:05 +0000 (11:35 +0200)
alloc_targets() is always called with a newly initialized table where
t->highs == NULL.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-table.c

index 933e01f3fab40d71ad8b3964d1552eb66475b7fa..a937e1e12482eefebaebd3ba7d283a0187e27a9d 100644 (file)
@@ -117,7 +117,6 @@ static int alloc_targets(struct dm_table *t, unsigned int num)
        n_targets = (struct dm_target *) (n_highs + num);
 
        memset(n_highs, -1, sizeof(*n_highs) * num);
-       kvfree(t->highs);
 
        t->num_allocated = num;
        t->highs = n_highs;