matrox maven: fix a broken error path
authorJean Delvare <[email protected]>
Tue, 12 Aug 2008 22:08:53 +0000 (15:08 -0700)
committerLinus Torvalds <[email protected]>
Tue, 12 Aug 2008 23:07:29 +0000 (16:07 -0700)
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 <[email protected]>
Acked-by: Krzysztof Helt <[email protected]>
Cc: Petr Vandrovec <[email protected]>
Cc: <[email protected]> [2.6.25.x, 2.6.26.x]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/video/matrox/matroxfb_maven.c

index 89da27bd5c498147d5308e3258af4f2a96349c7d..2ad06b0125c36814af16dda2bc7706bc08721984 100644 (file)
@@ -1266,7 +1266,7 @@ static int maven_detect_client(struct i2c_adapter* adapter, int address, int kin
 ERROR4:;
        i2c_detach_client(new_client);
 ERROR3:;
-       kfree(new_client);
+       kfree(data);
 ERROR0:;
        return err;
 }