[media] drxk: Proper handle/propagate the error codes
[pandora-kernel.git] / drivers / media / dvb / dvb-usb / vp7045-fe.c
index 83f1de1..8452eef 100644 (file)
@@ -26,7 +26,6 @@ struct vp7045_fe_state {
        struct dvb_usb_device *d;
 };
 
-
 static int vp7045_fe_read_status(struct dvb_frontend* fe, fe_status_t *status)
 {
        struct vp7045_fe_state *state = fe->demodulator_priv;
@@ -145,20 +144,17 @@ static struct dvb_frontend_ops vp7045_fe_ops;
 
 struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d)
 {
-       struct vp7045_fe_state *s = kmalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL);
+       struct vp7045_fe_state *s = kzalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL);
        if (s == NULL)
                goto error;
-       memset(s,0,sizeof(struct vp7045_fe_state));
 
        s->d = d;
-       s->fe.ops = &vp7045_fe_ops;
+       memcpy(&s->fe.ops, &vp7045_fe_ops, sizeof(struct dvb_frontend_ops));
        s->fe.demodulator_priv = s;
 
-       goto success;
+       return &s->fe;
 error:
        return NULL;
-success:
-       return &s->fe;
 }