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/qla2xxx | |
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/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 290a6b92616c..72d9090df3df 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -1977,8 +1977,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha) | |||
1977 | } | 1977 | } |
1978 | 1978 | ||
1979 | cleanup_allocation: | 1979 | cleanup_allocation: |
1980 | if (new_fcport) | 1980 | kfree(new_fcport); |
1981 | kfree(new_fcport); | ||
1982 | 1981 | ||
1983 | if (rval != QLA_SUCCESS) { | 1982 | if (rval != QLA_SUCCESS) { |
1984 | DEBUG2(printk("scsi(%ld): Configure local loop error exit: " | 1983 | DEBUG2(printk("scsi(%ld): Configure local loop error exit: " |
@@ -2348,8 +2347,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports) | |||
2348 | /* Allocate temporary fcport for any new fcports discovered. */ | 2347 | /* Allocate temporary fcport for any new fcports discovered. */ |
2349 | new_fcport = qla2x00_alloc_fcport(ha, GFP_KERNEL); | 2348 | new_fcport = qla2x00_alloc_fcport(ha, GFP_KERNEL); |
2350 | if (new_fcport == NULL) { | 2349 | if (new_fcport == NULL) { |
2351 | if (swl) | 2350 | kfree(swl); |
2352 | kfree(swl); | ||
2353 | return (QLA_MEMORY_ALLOC_FAILED); | 2351 | return (QLA_MEMORY_ALLOC_FAILED); |
2354 | } | 2352 | } |
2355 | new_fcport->flags |= (FCF_FABRIC_DEVICE | FCF_LOGIN_NEEDED); | 2353 | new_fcport->flags |= (FCF_FABRIC_DEVICE | FCF_LOGIN_NEEDED); |
@@ -2485,19 +2483,15 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports) | |||
2485 | nxt_d_id.b24 = new_fcport->d_id.b24; | 2483 | nxt_d_id.b24 = new_fcport->d_id.b24; |
2486 | new_fcport = qla2x00_alloc_fcport(ha, GFP_KERNEL); | 2484 | new_fcport = qla2x00_alloc_fcport(ha, GFP_KERNEL); |
2487 | if (new_fcport == NULL) { | 2485 | if (new_fcport == NULL) { |
2488 | if (swl) | 2486 | kfree(swl); |
2489 | kfree(swl); | ||
2490 | return (QLA_MEMORY_ALLOC_FAILED); | 2487 | return (QLA_MEMORY_ALLOC_FAILED); |
2491 | } | 2488 | } |
2492 | new_fcport->flags |= (FCF_FABRIC_DEVICE | FCF_LOGIN_NEEDED); | 2489 | new_fcport->flags |= (FCF_FABRIC_DEVICE | FCF_LOGIN_NEEDED); |
2493 | new_fcport->d_id.b24 = nxt_d_id.b24; | 2490 | new_fcport->d_id.b24 = nxt_d_id.b24; |
2494 | } | 2491 | } |
2495 | 2492 | ||
2496 | if (swl) | 2493 | kfree(swl); |
2497 | kfree(swl); | 2494 | kfree(new_fcport); |
2498 | |||
2499 | if (new_fcport) | ||
2500 | kfree(new_fcport); | ||
2501 | 2495 | ||
2502 | if (!list_empty(new_fcports)) | 2496 | if (!list_empty(new_fcports)) |
2503 | ha->device_flags |= DFLG_FABRIC_DEVICES; | 2497 | ha->device_flags |= DFLG_FABRIC_DEVICES; |