Browse Source

[media] dib8000: fix small memory leak on error

kfree(state) if fe allocation fails.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Dan Carpenter 14 years ago
parent
commit
ed54c0e33c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/media/dvb/frontends/dib8000.c

+ 1 - 1
drivers/media/dvb/frontends/dib8000.c

@@ -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;