From 0cc01319857fa9e0ddeefc3be2ed9839d510c1c4 Mon Sep 17 00:00:00 2001 From: Michael Hunold Date: Tue, 22 Jun 2004 13:42:48 +0000 Subject: =?UTF-8?q?-=20don't=20leak=20memory,=20thanks=20to=20Kenneth=20Aa?= =?UTF-8?q?fl=C3=B8y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- linux/drivers/media/dvb/frontends/stv0299.c | 5 +++-- linux/drivers/media/dvb/frontends/ves1x93.c | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'linux/drivers') diff --git a/linux/drivers/media/dvb/frontends/stv0299.c b/linux/drivers/media/dvb/frontends/stv0299.c index 17d6a6035..cd63d9b7d 100644 --- a/linux/drivers/media/dvb/frontends/stv0299.c +++ b/linux/drivers/media/dvb/frontends/stv0299.c @@ -1388,20 +1388,21 @@ static int attach_adapter(struct i2c_adapter *adapter) static int detach_client(struct i2c_client *client) { + struct stv0299_data *data = (struct stv0299_data*)i2c_get_clientdata(client); i2c_detach_client(client); kfree(client); + kfree(data); return 0; } static int command (struct i2c_client *client, unsigned int cmd, void *arg) { - struct stv0299_data *data = (struct stv0299_data*)i2c_get_clientdata(client); - dprintk ("%s\n", __FUNCTION__); switch (cmd) { case FE_REGISTER: { struct dvb_adapter *dvb_adapter = (struct dvb_adapter*)arg; + struct stv0299_data *data = (struct stv0299_data*)i2c_get_clientdata(client); return dvb_register_frontend_new (uni0299_ioctl, dvb_adapter, (void*) data, &uni0299_info); } case FE_UNREGISTER: { diff --git a/linux/drivers/media/dvb/frontends/ves1x93.c b/linux/drivers/media/dvb/frontends/ves1x93.c index 75523847b..7b36065a4 100644 --- a/linux/drivers/media/dvb/frontends/ves1x93.c +++ b/linux/drivers/media/dvb/frontends/ves1x93.c @@ -637,20 +637,21 @@ static int attach_adapter(struct i2c_adapter *adapter) static int detach_client(struct i2c_client *client) { + struct ves1x93_state *data = (struct ves1x93_state*)i2c_get_clientdata(client); i2c_detach_client(client); kfree(client); + kfree(state); return 0; } static int command (struct i2c_client *client, unsigned int cmd, void *arg) { - struct stv0299_data *data = (struct stv0299_data*)i2c_get_clientdata(client); - dprintk ("%s\n", __FUNCTION__); switch (cmd) { case FE_REGISTER: { struct dvb_adapter *dvb_adapter = (struct dvb_adapter*)arg; + struct ves1x93_state *data = (struct ves1x93_state*)i2c_get_clientdata(client); return dvb_register_frontend_new (ves1x93_ioctl, dvb_adapter, (void*) data, &ves1x93_info); } case FE_UNREGISTER: { @@ -675,7 +676,7 @@ static struct i2c_driver driver = { }; static struct i2c_client client_template = { - I2C_DEVNAME("stv0299"), + I2C_DEVNAME("ves1x93"), .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; -- cgit v1.2.3