aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2005-07-07 20:57:52 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:56 -0400
commit771e71570ce4da549fe89978de0a29e3299d7fb7 (patch)
tree2003fa14c8073a30d70ef28c4da40c4fcb1c961f /drivers/media/dvb
parent3dff919425dd79954447e6ab39807b4c27ba3089 (diff)
[PATCH] dvb: ttusb-dec: kfree cleanup
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>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/ttusb-dec/ttusbdecfe.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/media/dvb/ttusb-dec/ttusbdecfe.c b/drivers/media/dvb/ttusb-dec/ttusbdecfe.c
index 1699cc9f6bb0..725af3af5b27 100644
--- a/drivers/media/dvb/ttusb-dec/ttusbdecfe.c
+++ b/drivers/media/dvb/ttusb-dec/ttusbdecfe.c
@@ -157,7 +157,8 @@ struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* conf
157 157
158 /* allocate memory for the internal state */ 158 /* allocate memory for the internal state */
159 state = (struct ttusbdecfe_state*) kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL); 159 state = (struct ttusbdecfe_state*) kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL);
160 if (state == NULL) goto error; 160 if (state == NULL)
161 return NULL;
161 162
162 /* setup the state */ 163 /* setup the state */
163 state->config = config; 164 state->config = config;
@@ -167,10 +168,6 @@ struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* conf
167 state->frontend.ops = &state->ops; 168 state->frontend.ops = &state->ops;
168 state->frontend.demodulator_priv = state; 169 state->frontend.demodulator_priv = state;
169 return &state->frontend; 170 return &state->frontend;
170
171error:
172 kfree(state);
173 return NULL;
174} 171}
175 172
176static struct dvb_frontend_ops ttusbdecfe_dvbs_ops; 173static struct dvb_frontend_ops ttusbdecfe_dvbs_ops;
@@ -181,7 +178,8 @@ struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* conf
181 178
182 /* allocate memory for the internal state */ 179 /* allocate memory for the internal state */
183 state = (struct ttusbdecfe_state*) kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL); 180 state = (struct ttusbdecfe_state*) kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL);
184 if (state == NULL) goto error; 181 if (state == NULL)
182 return NULL;
185 183
186 /* setup the state */ 184 /* setup the state */
187 state->config = config; 185 state->config = config;
@@ -193,10 +191,6 @@ struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* conf
193 state->frontend.ops = &state->ops; 191 state->frontend.ops = &state->ops;
194 state->frontend.demodulator_priv = state; 192 state->frontend.demodulator_priv = state;
195 return &state->frontend; 193 return &state->frontend;
196
197error:
198 kfree(state);
199 return NULL;
200} 194}
201 195
202static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = { 196static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = {