Skip to content
Commit 0e820ab6 authored by Julia Lawall's avatar Julia Lawall Committed by Samuel Ortiz
Browse files

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/

)

// <smpl>
@@
expression x,e;
identifier f;
iterator I;
statement S;
@@

*kfree(x);
... when != &x
    when != x = e
    when != I(x,...) S
*x->f
// </smpl>

Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
parent 1ecc09e7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment