public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Alex Woods <linux-dvb@giblets.org>
Cc: linux-dvb-maintainer@linuxtv.org, linux-kernel@vger.kernel.org
Subject: [2.6 patch] drivers/media/dvb/ttusb-dec/ttusbdecfe.c: remove dead code
Date: Tue, 22 Mar 2005 23:04:57 +0100	[thread overview]
Message-ID: <20050322220457.GR1948@stusta.de> (raw)

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",


             reply	other threads:[~2005-03-22 22:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-22 22:04 Adrian Bunk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-06-21 17:50 [2.6 patch] drivers/media/dvb/ttusb-dec/ttusbdecfe.c: remove dead code Adrian Bunk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050322220457.GR1948@stusta.de \
    --to=bunk@stusta.de \
    --cc=linux-dvb-maintainer@linuxtv.org \
    --cc=linux-dvb@giblets.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox