diff options
author | Adrian Bunk <bunk@stusta.de> | 2005-07-07 20:57:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-07 21:23:56 -0400 |
commit | 771e71570ce4da549fe89978de0a29e3299d7fb7 (patch) | |
tree | 2003fa14c8073a30d70ef28c4da40c4fcb1c961f /drivers/media/dvb/ttusb-dec | |
parent | 3dff919425dd79954447e6ab39807b4c27ba3089 (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/ttusb-dec')
-rw-r--r-- | drivers/media/dvb/ttusb-dec/ttusbdecfe.c | 14 |
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 1699cc9f6bb..725af3af5b2 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 | |||
171 | error: | ||
172 | kfree(state); | ||
173 | return NULL; | ||
174 | } | 171 | } |
175 | 172 | ||
176 | static struct dvb_frontend_ops ttusbdecfe_dvbs_ops; | 173 | static 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 | |||
197 | error: | ||
198 | kfree(state); | ||
199 | return NULL; | ||
200 | } | 194 | } |
201 | 195 | ||
202 | static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = { | 196 | static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = { |