1
0

[PATCH] kfree cleanup: drivers/scsi

This is the drivers/scsi/ part of the big kfree cleanup patch.

Remove pointless checks for NULL prior to calling kfree() in drivers/scsi/.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Acked-by: Kai Makisara <kai.makisara@kolumbus.fi>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Jesper Juhl
2005-11-07 01:01:26 -08:00
committed by Linus Torvalds
parent 089b1dbbde
commit c9475cb0c3
21 changed files with 73 additions and 141 deletions

View File

@@ -1037,18 +1037,10 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
if(pHba->msg_addr_virt != pHba->base_addr_virt){
iounmap(pHba->msg_addr_virt);
}
if(pHba->hrt) {
kfree(pHba->hrt);
}
if(pHba->lct){
kfree(pHba->lct);
}
if(pHba->status_block) {
kfree(pHba->status_block);
}
if(pHba->reply_pool){
kfree(pHba->reply_pool);
}
kfree(pHba->hrt);
kfree(pHba->lct);
kfree(pHba->status_block);
kfree(pHba->reply_pool);
for(d = pHba->devices; d ; d = next){
next = d->next;
@@ -2706,14 +2698,12 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
// If the command was successful, fill the fifo with our reply
// message packets
if(*status != 0x04 /*I2O_EXEC_OUTBOUND_INIT_COMPLETE*/) {
kfree((void*)status);
kfree(status);
return -2;
}
kfree((void*)status);
kfree(status);
if(pHba->reply_pool != NULL){
kfree(pHba->reply_pool);
}
kfree(pHba->reply_pool);
pHba->reply_pool = (u32*)kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32);
if(!pHba->reply_pool){
@@ -2929,8 +2919,7 @@ static int adpt_i2o_build_sys_table(void)
sys_tbl_len = sizeof(struct i2o_sys_tbl) + // Header + IOPs
(hba_count) * sizeof(struct i2o_sys_tbl_entry);
if(sys_tbl)
kfree(sys_tbl);
kfree(sys_tbl);
sys_tbl = kmalloc(sys_tbl_len, GFP_KERNEL|ADDR32);
if(!sys_tbl) {