diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2005-11-07 04:01:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:54:01 -0500 |
commit | c9475cb0c358ff0dd473544280d92482df491913 (patch) | |
tree | 091617d0bdab9273d44139c86af21b7540e6d9b1 /drivers/scsi/dpt_i2o.c | |
parent | 089b1dbbde28f0f641c20beabba28fa89ab4fab9 (diff) |
[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>
Diffstat (limited to 'drivers/scsi/dpt_i2o.c')
-rw-r--r-- | drivers/scsi/dpt_i2o.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 46d5571ec55a..c28e3aea1c3c 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -1037,18 +1037,10 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba) | |||
1037 | if(pHba->msg_addr_virt != pHba->base_addr_virt){ | 1037 | if(pHba->msg_addr_virt != pHba->base_addr_virt){ |
1038 | iounmap(pHba->msg_addr_virt); | 1038 | iounmap(pHba->msg_addr_virt); |
1039 | } | 1039 | } |
1040 | if(pHba->hrt) { | 1040 | kfree(pHba->hrt); |
1041 | kfree(pHba->hrt); | 1041 | kfree(pHba->lct); |
1042 | } | 1042 | kfree(pHba->status_block); |
1043 | if(pHba->lct){ | 1043 | kfree(pHba->reply_pool); |
1044 | kfree(pHba->lct); | ||
1045 | } | ||
1046 | if(pHba->status_block) { | ||
1047 | kfree(pHba->status_block); | ||
1048 | } | ||
1049 | if(pHba->reply_pool){ | ||
1050 | kfree(pHba->reply_pool); | ||
1051 | } | ||
1052 | 1044 | ||
1053 | for(d = pHba->devices; d ; d = next){ | 1045 | for(d = pHba->devices; d ; d = next){ |
1054 | next = d->next; | 1046 | next = d->next; |
@@ -2706,14 +2698,12 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba) | |||
2706 | // If the command was successful, fill the fifo with our reply | 2698 | // If the command was successful, fill the fifo with our reply |
2707 | // message packets | 2699 | // message packets |
2708 | if(*status != 0x04 /*I2O_EXEC_OUTBOUND_INIT_COMPLETE*/) { | 2700 | if(*status != 0x04 /*I2O_EXEC_OUTBOUND_INIT_COMPLETE*/) { |
2709 | kfree((void*)status); | 2701 | kfree(status); |
2710 | return -2; | 2702 | return -2; |
2711 | } | 2703 | } |
2712 | kfree((void*)status); | 2704 | kfree(status); |
2713 | 2705 | ||
2714 | if(pHba->reply_pool != NULL){ | 2706 | kfree(pHba->reply_pool); |
2715 | kfree(pHba->reply_pool); | ||
2716 | } | ||
2717 | 2707 | ||
2718 | pHba->reply_pool = (u32*)kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32); | 2708 | pHba->reply_pool = (u32*)kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32); |
2719 | if(!pHba->reply_pool){ | 2709 | if(!pHba->reply_pool){ |
@@ -2929,8 +2919,7 @@ static int adpt_i2o_build_sys_table(void) | |||
2929 | sys_tbl_len = sizeof(struct i2o_sys_tbl) + // Header + IOPs | 2919 | sys_tbl_len = sizeof(struct i2o_sys_tbl) + // Header + IOPs |
2930 | (hba_count) * sizeof(struct i2o_sys_tbl_entry); | 2920 | (hba_count) * sizeof(struct i2o_sys_tbl_entry); |
2931 | 2921 | ||
2932 | if(sys_tbl) | 2922 | kfree(sys_tbl); |
2933 | kfree(sys_tbl); | ||
2934 | 2923 | ||
2935 | sys_tbl = kmalloc(sys_tbl_len, GFP_KERNEL|ADDR32); | 2924 | sys_tbl = kmalloc(sys_tbl_len, GFP_KERNEL|ADDR32); |
2936 | if(!sys_tbl) { | 2925 | if(!sys_tbl) { |