diff options
Diffstat (limited to 'drivers/media/dvb-frontends/mb86a20s.c')
-rw-r--r-- | drivers/media/dvb-frontends/mb86a20s.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index e8ac8c3e2ec0..bdaf9d235fed 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -2071,12 +2071,9 @@ struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config, dev_dbg(&i2c->dev, "%s called.\n", __func__); /* allocate memory for the internal state */ - state = kzalloc(sizeof(struct mb86a20s_state), GFP_KERNEL); - if (state == NULL) { - dev_err(&i2c->dev, - "%s: unable to allocate memory for state\n", __func__); - goto error; - } + state = kzalloc(sizeof(*state), GFP_KERNEL); + if (!state) + return NULL; /* setup the state */ state->config = config; @@ -2089,22 +2086,16 @@ struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config, /* Check if it is a mb86a20s frontend */ rev = mb86a20s_readreg(state, 0); - - if (rev == 0x13) { - dev_info(&i2c->dev, - "Detected a Fujitsu mb86a20s frontend\n"); - } else { + if (rev != 0x13) { + kfree(state); dev_dbg(&i2c->dev, "Frontend revision %d is unknown - aborting.\n", rev); - goto error; + return NULL; } + dev_info(&i2c->dev, "Detected a Fujitsu mb86a20s frontend\n"); return &state->frontend; - -error: - kfree(state); - return NULL; } EXPORT_SYMBOL(mb86a20s_attach); |