From: Julia Lawall Date: Wed, 27 Oct 2010 22:33:28 +0000 (-0700) Subject: drivers/video/gbefb.c: eliminate memory leak X-Git-Tag: v2.6.37-rc1~85^2~105 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f35691062a138484b51bf53b36ae8a4495d8fb91;p=pandora-kernel.git drivers/video/gbefb.c: eliminate memory leak This code is preceded by a call to framebuffer_alloc, which allocates memory, so this memory should be freed before leaving the function in an error case. out_release_framebuffer just frees the frame buffer and returns. A simplified version of the semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // @r exists@ local idexpression x; expression E; identifier f1; iterator I; @@ x = framebuffer_alloc(...); <... when != x when != true (x == NULL || ...) when != if (...) { <+...x...+> } when != I (...) { <+...x...+> } ( x == NULL | x == E | x->f1 ) ...> * return ...; // Signed-off-by: Julia Lawall Cc: Ralf Baechle Cc: Arnaud Patard Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed