Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[powerpc.git] / drivers / media / dvb / dvb-usb / dtt200u-fe.c
index b032523..17413ad 100644 (file)
@@ -155,23 +155,20 @@ struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d)
        struct dtt200u_fe_state* state = NULL;
 
        /* allocate memory for the internal state */
-       state = (struct dtt200u_fe_state*) kmalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL);
+       state = kzalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL);
        if (state == NULL)
                goto error;
-       memset(state,0,sizeof(struct dtt200u_fe_state));
 
        deb_info("attaching frontend dtt200u\n");
 
        state->d = d;
 
-       state->frontend.ops = &dtt200u_fe_ops;
+       memcpy(&state->frontend.ops,&dtt200u_fe_ops,sizeof(struct dvb_frontend_ops));
        state->frontend.demodulator_priv = state;
 
-       goto success;
+       return &state->frontend;
 error:
        return NULL;
-success:
-       return &state->frontend;
 }
 
 static struct dvb_frontend_ops dtt200u_fe_ops = {