Skip to content

Commit d84287b

Browse files
author
Nicholas Bellinger
committed
target/iblock: Fix double bioset_integrity_free bug
This patch fixes a double free bug during IBLOCK backend shutdown where bioset_integrity_free() was incorrectly called ahead of bioset_free(), who is already making the same call directly. This bug was introduced with commit ecebbf6, and will end up triggering a general protection fault in iblock_free_device() Reviewed-by: Sagi Grimberg <[email protected]> Cc: Martin K. Petersen <[email protected]> Cc: Or Gerlitz <[email protected]> Cc: Quinn Tran <[email protected]> Cc: Giridhar Malavali <[email protected]> Cc: <[email protected]> #3.14+ Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent a1e1774 commit d84287b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/target/target_core_iblock.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,9 @@ static void iblock_free_device(struct se_device *dev)
203203

204204
if (ib_dev->ibd_bd != NULL)
205205
blkdev_put(ib_dev->ibd_bd, FMODE_WRITE|FMODE_READ|FMODE_EXCL);
206-
if (ib_dev->ibd_bio_set != NULL) {
207-
bioset_integrity_free(ib_dev->ibd_bio_set);
206+
if (ib_dev->ibd_bio_set != NULL)
208207
bioset_free(ib_dev->ibd_bio_set);
209-
}
208+
210209
kfree(ib_dev);
211210
}
212211

0 commit comments

Comments
 (0)