diff options
-rw-r--r-- | linux/drivers/media/dvb/frontends/ves1820.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/linux/drivers/media/dvb/frontends/ves1820.c b/linux/drivers/media/dvb/frontends/ves1820.c index 09949c12f..c8c2fdd9b 100644 --- a/linux/drivers/media/dvb/frontends/ves1820.c +++ b/linux/drivers/media/dvb/frontends/ves1820.c @@ -539,14 +539,13 @@ static int attach_adapter(struct i2c_adapter *adapter) return -ENOMEM; } + memset(state, 0, sizeof(*state)); state->i2c = adapter; state->tuner = tuner_type; state->pwm = read_pwm(adapter); state->reg0 = ves1820_inittab[0]; state->demod_addr = demod_addr; - /* todo: honour user pwm setting somehow */ - memcpy(client, &client_template, sizeof(struct i2c_client)); client->adapter = adapter; client->addr = addr[tuner_type]; @@ -557,7 +556,7 @@ static int attach_adapter(struct i2c_adapter *adapter) if (ret) { kfree(client); kfree(state); - return -EFAULT; + return ret; } BUG_ON(!state->dvb); @@ -569,7 +568,7 @@ static int attach_adapter(struct i2c_adapter *adapter) i2c_detach_client(client); kfree(client); kfree(state); - return -EFAULT; + return ret; } return 0; |