summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Knorr <kraxel@bytesex.org>2002-07-14 03:35:23 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-07-14 03:35:23 -0700
commit5150c802ecfb2e2779cb96296399d25ad6e33e4a (patch)
treeccef169fd67f044c95384376f2c062a5528f3e3d
parenteffdd2b76db2d32850ea8d9318d502ab554c1055 (diff)
[PATCH] msp3400 fix
The patch below fixes a minor memory leak (forgotten kfree() on initialization errors) in the msp3400 module.
-rw-r--r--drivers/media/video/msp3400.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c
index b1188ce4d436..102f1461109a 100644
--- a/drivers/media/video/msp3400.c
+++ b/drivers/media/video/msp3400.c
@@ -1266,6 +1266,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr,
if (-1 == msp3400c_reset(c)) {
kfree(msp);
+ kfree(c);
dprintk("msp3400: no chip found\n");
return -1;
}
@@ -1275,6 +1276,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr,
rev2 = msp3400c_read(c, I2C_MSP3400C_DFP, 0x1f);
if ((-1 == rev1) || (0 == rev1 && 0 == rev2)) {
kfree(msp);
+ kfree(c);
printk("msp3400: error while reading chip version\n");
return -1;
}