Skip to contentSkip to conversation

drivers/media/dvb/ttusb-dec/ttusbdecfe.c: remove dead code

PATCH New Adrian Bunk 1 participant 1 message Jun 21, 2005 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/media/dvb/ttusb-dec/ttusbdecfe.c: remove dead code

The Coverity checker discovered that these two kfree's can never be executed.

---

 drivers/media/dvb/ttusb-dec/ttusbdecfe.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
drivers/media/dvb/ttusb-dec/ttusbdecfe.c renamed from drivers/media/dvb/ttusb-dec/ttusbdecfe.c.old +4 -10
@@ -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:
-	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:
-	kfree(state);
-	return NULL;
 }
 
 static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = {
 
 	.info = {
 		.name			= "TechnoTrend/Hauppauge DEC2000-t Frontend",