[patch 12/60] matrox maven: fix a broken error path

From: Greg KH
Date: Mon Aug 18 2008 - 14:50:05 EST


2.6.26-stable review patch. If anyone has any objections, please let us know.

------------------
From: Jean Delvare <khali@xxxxxxxxxxxx>

commit 5ede40f87957c6ededf9284c8339722a97b9dfb6 upstream

I broke an error path with d03c21ec0be7787ff6b75dcf56c0e96209ccbfbd,
sorry about that.

The machine will crash if the i2c_attach_client() or maven_init_client()
calls fail, although nobody has yet reported this happening.

Signed-off-by: Jean Delvare <khali@xxxxxxxxxxxx>
Acked-by: Krzysztof Helt <krzysztof.h1@xxxxx>
Cc: Petr Vandrovec <VANDROVE@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
drivers/video/matrox/matroxfb_maven.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/video/matrox/matroxfb_maven.c
+++ b/drivers/video/matrox/matroxfb_maven.c
@@ -1266,7 +1266,7 @@ static int maven_detect_client(struct i2
ERROR4:;
i2c_detach_client(new_client);
ERROR3:;
- kfree(new_client);
+ kfree(data);
ERROR0:;
return err;
}

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/