Skip to content

Commit

Permalink
[PATCH] dvb: ttusb-dec: kfree cleanup
Browse files Browse the repository at this point in the history
The Coverity checker discovered that these two kfree's can never be executed.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Adrian Bunk authored and Linus Torvalds committed Jul 8, 2005
1 parent 3dff919 commit 771e715
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions drivers/media/dvb/ttusb-dec/ttusbdecfe.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* conf

/* allocate memory for the internal state */
state = (struct ttusbdecfe_state*) kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL);
if (state == NULL) goto error;
if (state == NULL)
return NULL;

/* setup the state */
state->config = config;
Expand All @@ -167,10 +168,6 @@ struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* conf
state->frontend.ops = &state->ops;
state->frontend.demodulator_priv = state;
return &state->frontend;

error:
kfree(state);
return NULL;
}

static struct dvb_frontend_ops ttusbdecfe_dvbs_ops;
Expand All @@ -181,7 +178,8 @@ struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* conf

/* allocate memory for the internal state */
state = (struct ttusbdecfe_state*) kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL);
if (state == NULL) goto error;
if (state == NULL)
return NULL;

/* setup the state */
state->config = config;
Expand All @@ -193,10 +191,6 @@ struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* conf
state->frontend.ops = &state->ops;
state->frontend.demodulator_priv = state;
return &state->frontend;

error:
kfree(state);
return NULL;
}

static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = {
Expand Down

0 comments on commit 771e715

Please sign in to comment.