]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] msp3400 fix
authorGerd Knorr <kraxel@bytesex.org>
Sun, 14 Jul 2002 10:35:23 +0000 (03:35 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 14 Jul 2002 10:35:23 +0000 (03:35 -0700)
The patch below fixes a minor memory leak (forgotten kfree() on
initialization errors) in the msp3400 module.

drivers/media/video/msp3400.c

index b1188ce4d436cb5532495886a1363d30c4a9a653..102f1461109aebd83bcac9083848ad246c2083ef 100644 (file)
@@ -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;
        }