]> err.no Git - linux-2.6/commitdiff
V4L/DVB (7051): Cleans up error handling on or51xxx_attach
authorMauro Carvalho Chehab <mchehab@infradead.org>
Mon, 7 Jan 2008 13:45:47 +0000 (10:45 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 25 Jan 2008 21:05:09 +0000 (19:05 -0200)
state is already NULL.

Reviewed-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/frontends/or51132.c
drivers/media/dvb/frontends/or51211.c

index b314a1f2deed4ed12e16390aea097f039bcbd966..1d2d28ce823d4058a593cb7270a4cb4d277695a1 100644 (file)
@@ -564,7 +564,7 @@ struct dvb_frontend* or51132_attach(const struct or51132_config* config,
        /* Allocate memory for the internal state */
        state = kmalloc(sizeof(struct or51132_state), GFP_KERNEL);
        if (state == NULL)
-               goto error;
+               return NULL;
 
        /* Setup the state */
        state->config = config;
@@ -576,10 +576,6 @@ struct dvb_frontend* or51132_attach(const struct or51132_config* config,
        memcpy(&state->frontend.ops, &or51132_ops, sizeof(struct dvb_frontend_ops));
        state->frontend.demodulator_priv = state;
        return &state->frontend;
-
-error:
-       kfree(state);
-       return NULL;
 }
 
 static struct dvb_frontend_ops or51132_ops = {
index f02bd94459556a6874a5d23d83afb28a6bfebc87..6a6b0d727c6fc53ece47c2816086e8cf9025cf3f 100644 (file)
@@ -529,7 +529,7 @@ struct dvb_frontend* or51211_attach(const struct or51211_config* config,
        /* Allocate memory for the internal state */
        state = kmalloc(sizeof(struct or51211_state), GFP_KERNEL);
        if (state == NULL)
-               goto error;
+               return NULL;
 
        /* Setup the state */
        state->config = config;
@@ -541,10 +541,6 @@ struct dvb_frontend* or51211_attach(const struct or51211_config* config,
        memcpy(&state->frontend.ops, &or51211_ops, sizeof(struct dvb_frontend_ops));
        state->frontend.demodulator_priv = state;
        return &state->frontend;
-
-error:
-       kfree(state);
-       return NULL;
 }
 
 static struct dvb_frontend_ops or51211_ops = {