aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttusb-dec/ttusbdecfe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/ttusb-dec/ttusbdecfe.c')
-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 = {