]> err.no Git - linux-2.6/commitdiff
[PATCH] dvb: ttusb-dec: kfree cleanup
authorAdrian Bunk <bunk@stusta.de>
Fri, 8 Jul 2005 00:57:52 +0000 (17:57 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 8 Jul 2005 01:23:56 +0000 (18:23 -0700)
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>
drivers/media/dvb/ttusb-dec/ttusbdecfe.c

index 1699cc9f6bb0ddd563d4f49d8ce5b0609e95455a..725af3af5b27105f5c2e8555e68de691272e41fc 100644 (file)
@@ -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;
@@ -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;
@@ -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;
@@ -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 = {