From: Julia Lawall Date: Tue, 22 Dec 2009 20:31:43 +0000 (+0100) Subject: mfd: Correct use after free for t7l66xb X-Git-Tag: v2.6.34-rc1~9^2~62 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e820ab60118e06db62ef4e55b6dd96db807a34e;p=pandora-kernel.git mfd: Correct use after free for t7l66xb The structure t7l66xb should not be freed before the subsequent references to its fields in the arguments to clk_put. Furthermore, this structure is allocated near the beginning of the function, and a goto to the label err_noirq appears after a successful allocation, so it would seem that the kfree should be moved down below this label. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,e; identifier f; iterator I; statement S; @@ *kfree(x); ... when != &x when != x = e when != I(x,...) S *x->f // Signed-off-by: Julia Lawall --- Reading git-diff-tree failed