From: Julien Brunel Date: Wed, 19 Nov 2008 23:36:07 +0000 (-0800) Subject: drivers/video: bad error test before a dereference X-Git-Tag: v2.6.28-rc6~48 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf7b9a1e11993a064f445d332fecf22819b87a5e;p=pandora-kernel.git drivers/video: bad error test before a dereference The error test that follows the call to backlight_device_register semms not to concern the right variable. A simplified version of the semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @def0@ expression x; position p0; @@ x@p0 = backlight_device_register(...) @protected@ expression def0.x,E; position def0.p0; position p; statement S; @@ x@p0 ... when != x = E if (!IS_ERR(x) && ...) {<... x@p ...>} else S @unprotected@ expression def0.x; identifier fld; position def0.p0; position p != protected.p; @@ x@p0 ... when != x = E * x@p->fld // Signed-off-by: Julien Brunel Signed-off-by: Julia Lawall Acked-by: Nicolas Ferre Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed