Commit 8226ee76 authored by Jean Delvare's avatar Jean Delvare Committed by Greg Kroah-Hartman

matrox maven: fix a broken error path

commit 5ede40f8 upstream

I broke an error path with d03c21ec,
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: default avatarJean Delvare <khali@linux-fr.org>
Acked-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
Cc: Petr Vandrovec <VANDROVE@vc.cvut.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1a71e43a
...@@ -1266,7 +1266,7 @@ static int maven_detect_client(struct i2c_adapter* adapter, int address, int kin ...@@ -1266,7 +1266,7 @@ static int maven_detect_client(struct i2c_adapter* adapter, int address, int kin
ERROR4:; ERROR4:;
i2c_detach_client(new_client); i2c_detach_client(new_client);
ERROR3:; ERROR3:;
kfree(new_client); kfree(data);
ERROR0:; ERROR0:;
return err; return err;
} }
......
Markdown is supported
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