diff options
author | Jesper Juhl <jj@chaosbits.net> | 2013-01-20 17:14:43 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-01-20 18:07:15 -0500 |
commit | bec0b2ce8304bedf56935c44912716882a365adb (patch) | |
tree | aa943fc1155ef59d2ff4fcf9b8b4819fe2107cf3 /drivers/pcmcia/rsrc_nonstatic.c | |
parent | 4de80273a2ffc619f7fa20d85c37e6ba1bbae1ed (diff) |
pcmcia: avoid static analysis complaint about use-after-free
Coverity complains about a use after free for 'res1' and 'res2' since
we use the value of the pointers in a 'dev_dbg()' after they have been
freed. That's not really a problem, but it still seems cleaner to
defer freeing until we are completely done with the pointers.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/pcmcia/rsrc_nonstatic.c')
-rw-r--r-- | drivers/pcmcia/rsrc_nonstatic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c index 9da9656242af..dcce10eb5ad9 100644 --- a/drivers/pcmcia/rsrc_nonstatic.c +++ b/drivers/pcmcia/rsrc_nonstatic.c | |||
@@ -369,12 +369,12 @@ static int do_validate_mem(struct pcmcia_socket *s, | |||
369 | } | 369 | } |
370 | } | 370 | } |
371 | 371 | ||
372 | free_region(res2); | ||
373 | free_region(res1); | ||
374 | |||
375 | dev_dbg(&s->dev, "cs: memory probe 0x%06lx-0x%06lx: %p %p %u %u %u", | 372 | dev_dbg(&s->dev, "cs: memory probe 0x%06lx-0x%06lx: %p %p %u %u %u", |
376 | base, base+size-1, res1, res2, ret, info1, info2); | 373 | base, base+size-1, res1, res2, ret, info1, info2); |
377 | 374 | ||
375 | free_region(res2); | ||
376 | free_region(res1); | ||
377 | |||
378 | if ((ret) || (info1 != info2) || (info1 == 0)) | 378 | if ((ret) || (info1 != info2) || (info1 == 0)) |
379 | return -EINVAL; | 379 | return -EINVAL; |
380 | 380 | ||