summaryrefslogtreecommitdiff
path: root/drivers/scsi/dpt_i2o.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-12-16 12:35:39 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2017-01-05 08:21:12 +0300
commit19099dc393f3ca1fd9690f914e50278cf2aee78a (patch)
tree4b03d6a61cf90206bdc5863d42087c803f56aa8d /drivers/scsi/dpt_i2o.c
parente0075478ca7c58c6ad6630310aaa3f64a25dcf31 (diff)
downloadlinux-19099dc393f3ca1fd9690f914e50278cf2aee78a.tar.xz
scsi: dpt_i2o: double free if adpt_i2o_online_hba() fails
There are two places where adpt_i2o_online_hba() is called. Both callers call adpt_i2o_delete_hba(pHba) if adpt_i2o_online_hba() fails and since we also free it here that causes a double free bug. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/dpt_i2o.c')
-rw-r--r--drivers/scsi/dpt_i2o.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 5f75e638ec95..256dd6791fcc 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -2768,16 +2768,12 @@ static int adpt_i2o_activate_hba(adpt_hba* pHba)
static int adpt_i2o_online_hba(adpt_hba* pHba)
{
- if (adpt_i2o_systab_send(pHba) < 0) {
- adpt_i2o_delete_hba(pHba);
+ if (adpt_i2o_systab_send(pHba) < 0)
return -1;
- }
/* In READY state */
- if (adpt_i2o_enable_hba(pHba) < 0) {
- adpt_i2o_delete_hba(pHba);
+ if (adpt_i2o_enable_hba(pHba) < 0)
return -1;
- }
/* In OPERATIONAL state */
return 0;