[media] dib8000: fix small memory leak on error
authorDan Carpenter <error27@gmail.com>
Wed, 19 Jan 2011 14:27:58 +0000 (11:27 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 21 Mar 2011 23:32:39 +0000 (20:32 -0300)
kfree(state) if fe allocation fails.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/dib8000.c

index 3e20aa8db23baa655e7a942883dfe39c0306f894..c1c3e26906e2843b7893fa666c4929cf8442e7e4 100644 (file)
@@ -2514,7 +2514,7 @@ struct dvb_frontend *dib8000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, s
                return NULL;
        fe = kzalloc(sizeof(struct dvb_frontend), GFP_KERNEL);
        if (fe == NULL)
-               return NULL;
+               goto error;
 
        memcpy(&state->cfg, cfg, sizeof(struct dib8000_config));
        state->i2c.adap = i2c_adap;