Skip to contentSkip to conversation

fs: bio-integrity: fix possible segmentation fault

PATCH In review Andi Shyti 2 participants 2 messages Jul 23, 2013 – Jul 24, 2013 VFS

lore
Share & tools
lore

Andi Shyti

author
#0 lore raw

PATCH 1/1 fs: bio-integrity: fix possible segmentation fault

free bvec_integrity_pool if it's allocated, not bio_integrity_pool

---
 fs/bio-integrity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/bio-integrity.c +1 -1
index 8fb4291..45e944f 100644
@@ -734,7 +734,7 @@ void bioset_integrity_free(struct bio_set *bs)
 		mempool_destroy(bs->bio_integrity_pool);
 
 	if (bs->bvec_integrity_pool)
-		mempool_destroy(bs->bio_integrity_pool);
+		mempool_destroy(bs->bvec_integrity_pool);
 }
 EXPORT_SYMBOL(bioset_integrity_free);
 
Signature · 1 line
1.8.3.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Andi Shyti

free bvec_integrity_pool if it's allocated, not bio_integrity_pool

Quoted 17 lines
---
 fs/bio-integrity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/bio-integrity.c +1 -1
index 8fb4291..45e944f 100644
@@ -734,7 +734,7 @@ void bioset_integrity_free(struct bio_set *bs)
 		mempool_destroy(bs->bio_integrity_pool);
 
 	if (bs->bvec_integrity_pool)
-		mempool_destroy(bs->bio_integrity_pool);
+		mempool_destroy(bs->bvec_integrity_pool);
 }
 EXPORT_SYMBOL(bioset_integrity_free);