Commit 3473e342 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (7051): Cleans up error handling on or51xxx_attach

state is already NULL.
Reviewed-by: default avatarTrent Piepho <xyzzy@speakeasy.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 4e8a23ea
...@@ -564,7 +564,7 @@ struct dvb_frontend* or51132_attach(const struct or51132_config* config, ...@@ -564,7 +564,7 @@ struct dvb_frontend* or51132_attach(const struct or51132_config* config,
/* Allocate memory for the internal state */ /* Allocate memory for the internal state */
state = kmalloc(sizeof(struct or51132_state), GFP_KERNEL); state = kmalloc(sizeof(struct or51132_state), GFP_KERNEL);
if (state == NULL) if (state == NULL)
goto error; return NULL;
/* Setup the state */ /* Setup the state */
state->config = config; state->config = config;
...@@ -576,10 +576,6 @@ struct dvb_frontend* or51132_attach(const struct or51132_config* config, ...@@ -576,10 +576,6 @@ struct dvb_frontend* or51132_attach(const struct or51132_config* config,
memcpy(&state->frontend.ops, &or51132_ops, sizeof(struct dvb_frontend_ops)); memcpy(&state->frontend.ops, &or51132_ops, sizeof(struct dvb_frontend_ops));
state->frontend.demodulator_priv = state; state->frontend.demodulator_priv = state;
return &state->frontend; return &state->frontend;
error:
kfree(state);
return NULL;
} }
static struct dvb_frontend_ops or51132_ops = { static struct dvb_frontend_ops or51132_ops = {
......
...@@ -529,7 +529,7 @@ struct dvb_frontend* or51211_attach(const struct or51211_config* config, ...@@ -529,7 +529,7 @@ struct dvb_frontend* or51211_attach(const struct or51211_config* config,
/* Allocate memory for the internal state */ /* Allocate memory for the internal state */
state = kmalloc(sizeof(struct or51211_state), GFP_KERNEL); state = kmalloc(sizeof(struct or51211_state), GFP_KERNEL);
if (state == NULL) if (state == NULL)
goto error; return NULL;
/* Setup the state */ /* Setup the state */
state->config = config; state->config = config;
...@@ -541,10 +541,6 @@ struct dvb_frontend* or51211_attach(const struct or51211_config* config, ...@@ -541,10 +541,6 @@ struct dvb_frontend* or51211_attach(const struct or51211_config* config,
memcpy(&state->frontend.ops, &or51211_ops, sizeof(struct dvb_frontend_ops)); memcpy(&state->frontend.ops, &or51211_ops, sizeof(struct dvb_frontend_ops));
state->frontend.demodulator_priv = state; state->frontend.demodulator_priv = state;
return &state->frontend; return &state->frontend;
error:
kfree(state);
return NULL;
} }
static struct dvb_frontend_ops or51211_ops = { static struct dvb_frontend_ops or51211_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment