[PATCH] kfree cleanup: misc remaining drivers

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

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

Signed-off-by: Jesper Juhl <[email protected]>
Acked-by: Aristeu Sergio Rozanski Filho <[email protected]>
Acked-by: Roland Dreier <[email protected]>
Acked-by: Pierre Ossman <[email protected]>
Acked-by: Jean Delvare <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Len Brown <[email protected]>
Acked-by: "Antonino A. Daplas" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Jesper Juhl 2005-11-07 01:01:32 -08:00 • committed by Linus Torvalds
commit 6044ec8882
24 changed files with 83 additions and 151 deletions

View file

@ -554,8 +554,8 @@ int fcp_initialize(fc_channel *fcchain, int count)
l->logi = kzalloc (count * 3 * sizeof(logi), GFP_KERNEL);
l->fcmds = kzalloc (count * sizeof(fcp_cmnd), GFP_KERNEL);
if (!l->logi || !l->fcmds) {
if (l->logi) kfree (l->logi);
if (l->fcmds) kfree (l->fcmds);
kfree (l->logi);
kfree (l->fcmds);
kfree (l);
printk ("FC: Cannot allocate DMA memory for initialization\n");
return -ENOMEM;
@ -674,7 +674,6 @@ int fcp_forceoffline(fc_channel *fcchain, int count)
atomic_set (&l.todo, count);
l.fcmds = kzalloc (count * sizeof(fcp_cmnd), GFP_KERNEL);
if (!l.fcmds) {
kfree (l.fcmds);
printk ("FC: Cannot allocate memory for forcing offline\n");
return -ENOMEM;
}