Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bec0b2ce authored by Jesper Juhl's avatar Jesper Juhl Committed by Jiri Kosina
Browse files

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: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 4de80273
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -369,12 +369,12 @@ static int do_validate_mem(struct pcmcia_socket *s,
		}
	}

	free_region(res2);
	free_region(res1);

	dev_dbg(&s->dev, "cs: memory probe 0x%06lx-0x%06lx: %p %p %u %u %u",
		base, base+size-1, res1, res2, ret, info1, info2);

	free_region(res2);
	free_region(res1);

	if ((ret) || (info1 != info2) || (info1 == 0))
		return -EINVAL;