aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2014-04-02 23:35:02 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2014-04-07 04:48:54 -0400
commitd84287bcfe624697cd4f3c1df746beb53b86d9c4 (patch)
treefe68ddb1ec2c584f6cb9f5665bbf8a0cd090d785 /drivers/target
parenta1e1774c6dfa3a524dd8df51ca95185fe5ef3247 (diff)
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 ecebbf6cc, and will end up triggering a general protection fault in iblock_free_device() Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: Or Gerlitz <ogerlitz@mellanox.com> Cc: Quinn Tran <quinn.tran@qlogic.com> Cc: Giridhar Malavali <giridhar.malavali@qlogic.com> Cc: <stable@vger.kernel.org> #3.14+ Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_iblock.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 554d4f75a75a..9e0232cca92e 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -203,10 +203,9 @@ static void iblock_free_device(struct se_device *dev)
203 203
204 if (ib_dev->ibd_bd != NULL) 204 if (ib_dev->ibd_bd != NULL)
205 blkdev_put(ib_dev->ibd_bd, FMODE_WRITE|FMODE_READ|FMODE_EXCL); 205 blkdev_put(ib_dev->ibd_bd, FMODE_WRITE|FMODE_READ|FMODE_EXCL);
206 if (ib_dev->ibd_bio_set != NULL) { 206 if (ib_dev->ibd_bio_set != NULL)
207 bioset_integrity_free(ib_dev->ibd_bio_set);
208 bioset_free(ib_dev->ibd_bio_set); 207 bioset_free(ib_dev->ibd_bio_set);
209 } 208
210 kfree(ib_dev); 209 kfree(ib_dev);
211} 210}
212 211