Skip to content

Commit

Permalink
V4L/DVB (7051): Cleans up error handling on or51xxx_attach
Browse files Browse the repository at this point in the history
state is already NULL.

Reviewed-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Mauro Carvalho Chehab committed Jan 25, 2008
1 parent 4e8a23e commit 3473e34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions drivers/media/dvb/frontends/or51132.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ struct dvb_frontend* or51132_attach(const struct or51132_config* config,
/* Allocate memory for the internal state */
state = kmalloc(sizeof(struct or51132_state), GFP_KERNEL);
if (state == NULL)
goto error;
return NULL;

/* Setup the state */
state->config = config;
Expand All @@ -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));
state->frontend.demodulator_priv = state;
return &state->frontend;

error:
kfree(state);
return NULL;
}

static struct dvb_frontend_ops or51132_ops = {
Expand Down
6 changes: 1 addition & 5 deletions drivers/media/dvb/frontends/or51211.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ struct dvb_frontend* or51211_attach(const struct or51211_config* config,
/* Allocate memory for the internal state */
state = kmalloc(sizeof(struct or51211_state), GFP_KERNEL);
if (state == NULL)
goto error;
return NULL;

/* Setup the state */
state->config = config;
Expand All @@ -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));
state->frontend.demodulator_priv = state;
return &state->frontend;

error:
kfree(state);
return NULL;
}

static struct dvb_frontend_ops or51211_ops = {
Expand Down

0 comments on commit 3473e34

Please sign in to comment.