Commit 19099dc3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Martin K. Petersen

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e0075478
...@@ -2768,16 +2768,12 @@ static int adpt_i2o_activate_hba(adpt_hba* pHba) ...@@ -2768,16 +2768,12 @@ static int adpt_i2o_activate_hba(adpt_hba* pHba)
static int adpt_i2o_online_hba(adpt_hba* pHba) static int adpt_i2o_online_hba(adpt_hba* pHba)
{ {
if (adpt_i2o_systab_send(pHba) < 0) { if (adpt_i2o_systab_send(pHba) < 0)
adpt_i2o_delete_hba(pHba);
return -1; return -1;
}
/* In READY state */ /* In READY state */
if (adpt_i2o_enable_hba(pHba) < 0) { if (adpt_i2o_enable_hba(pHba) < 0)
adpt_i2o_delete_hba(pHba);
return -1; return -1;
}
/* In OPERATIONAL state */ /* In OPERATIONAL state */
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment