diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2005-11-07 04:01:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:54:05 -0500 |
commit | 6044ec8882c726e325017bd948aa0cd94ad33abc (patch) | |
tree | 3bfc5dc93434e8ad556540f6689abcd2699aa45d /drivers/pcmcia | |
parent | 2ea7533060e361810c21b2f5ee02151c4dfb85d8 (diff) |
[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 <jesper.juhl@gmail.com>
Acked-by: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
Acked-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Pierre Ossman <drzeus@drzeus.cx>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Len Brown <len.brown@intel.com>
Acked-by: "Antonino A. Daplas" <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/cistpl.c | 12 | ||||
-rw-r--r-- | drivers/pcmcia/cs.c | 6 |
2 files changed, 6 insertions, 12 deletions
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c index 3afb682255a0..2dc3e611a9a3 100644 --- a/drivers/pcmcia/cistpl.c +++ b/drivers/pcmcia/cistpl.c | |||
@@ -334,10 +334,8 @@ void destroy_cis_cache(struct pcmcia_socket *s) | |||
334 | /* | 334 | /* |
335 | * If there was a fake CIS, destroy that as well. | 335 | * If there was a fake CIS, destroy that as well. |
336 | */ | 336 | */ |
337 | if (s->fake_cis) { | 337 | kfree(s->fake_cis); |
338 | kfree(s->fake_cis); | 338 | s->fake_cis = NULL; |
339 | s->fake_cis = NULL; | ||
340 | } | ||
341 | } | 339 | } |
342 | EXPORT_SYMBOL(destroy_cis_cache); | 340 | EXPORT_SYMBOL(destroy_cis_cache); |
343 | 341 | ||
@@ -386,10 +384,8 @@ int verify_cis_cache(struct pcmcia_socket *s) | |||
386 | 384 | ||
387 | int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis) | 385 | int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis) |
388 | { | 386 | { |
389 | if (s->fake_cis != NULL) { | 387 | kfree(s->fake_cis); |
390 | kfree(s->fake_cis); | 388 | s->fake_cis = NULL; |
391 | s->fake_cis = NULL; | ||
392 | } | ||
393 | if (cis->Length > CISTPL_MAX_CIS_SIZE) | 389 | if (cis->Length > CISTPL_MAX_CIS_SIZE) |
394 | return CS_BAD_SIZE; | 390 | return CS_BAD_SIZE; |
395 | s->fake_cis = kmalloc(cis->Length, GFP_KERNEL); | 391 | s->fake_cis = kmalloc(cis->Length, GFP_KERNEL); |
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c index d5e76423a0ee..234cdca6fe13 100644 --- a/drivers/pcmcia/cs.c +++ b/drivers/pcmcia/cs.c | |||
@@ -331,10 +331,8 @@ static void shutdown_socket(struct pcmcia_socket *s) | |||
331 | cb_free(s); | 331 | cb_free(s); |
332 | #endif | 332 | #endif |
333 | s->functions = 0; | 333 | s->functions = 0; |
334 | if (s->config) { | 334 | kfree(s->config); |
335 | kfree(s->config); | 335 | s->config = NULL; |
336 | s->config = NULL; | ||
337 | } | ||
338 | 336 | ||
339 | { | 337 | { |
340 | int status; | 338 | int status; |