lkml.org 
[lkml]   [2005]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[2.6 patch] drivers/media/dvb/ttusb-dec/ttusbdecfe.c: remove dead code
The Coverity checker discovered that these two kfree's can never be 
executed.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

drivers/media/dvb/ttusb-dec/ttusbdecfe.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)

--- linux-2.6.12-rc1-mm1-full/drivers/media/dvb/ttusb-dec/ttusbdecfe.c.old 2005-03-22 20:34:45.000000000 +0100
+++ linux-2.6.12-rc1-mm1-full/drivers/media/dvb/ttusb-dec/ttusbdecfe.c 2005-03-22 20:37:41.000000000 +0100
@@ -154,52 +154,46 @@
struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* config)
{
struct ttusbdecfe_state* state = NULL;

/* 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;
memcpy(&state->ops, &ttusbdecfe_dvbt_ops, sizeof(struct dvb_frontend_ops));

/* create dvb_frontend */
state->frontend.ops = &state->ops;
state->frontend.demodulator_priv = state;
return &state->frontend;
-
-error:
- if (state) kfree(state);
- return NULL;
}

static struct dvb_frontend_ops ttusbdecfe_dvbs_ops;

struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* config)
{
struct ttusbdecfe_state* state = NULL;

/* 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;
state->voltage = 0;
state->hi_band = 0;
memcpy(&state->ops, &ttusbdecfe_dvbs_ops, sizeof(struct dvb_frontend_ops));

/* create dvb_frontend */
state->frontend.ops = &state->ops;
state->frontend.demodulator_priv = state;
return &state->frontend;
-
-error:
- if (state) kfree(state);
- return NULL;
}

static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = {

.info = {
.name = "TechnoTrend/Hauppauge DEC2000-t Frontend",
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-04-06 13:30    [W:0.023 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site