Skip to contentSkip to conversation

dm: remove unneeded kvfree from alloc_targets

PATCH In review Benjamin Marzinski 2 participants 2 messages May 15, 2024 Device mapper

lore
Share & tools
lore

Benjamin Marzinski

author maintainer
#0 lore raw

PATCH 1/1 dm: remove unneeded kvfree from alloc_targets

alloc_targets() is always called with a newly initialized table where t->highs == NULL.

---
 drivers/md/dm-table.c | 1 -
 1 file changed, 1 deletion(-)
drivers/md/dm-table.c +0 -1
index 88114719fe18..d124e37dfb00 100644
@@ -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;
Signature · 1 line
2.45.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Benjamin Marzinski

alloc_targets() is always called with a newly initialized table where t->highs == NULL.

Quoted 19 lines
---
 drivers/md/dm-table.c | 1 -
 1 file changed, 1 deletion(-)
drivers/md/dm-table.c +0 -1
index 88114719fe18..d124e37dfb00 100644
@@ -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;
Signature · 1 line
2.45.0