Commit 123aab28 authored by Patrick Boettcher's avatar Patrick Boettcher Committed by Mauro Carvalho Chehab

V4L/DVB (3312): FIX: Multiple usage of VP7045-based devices

Reassigning function pointers in a static led to infinite loops when using
multiple VP7045-based device at the same time on one system. Using kmalloc'd
copies for reassignments is better.
Signed-off-by: default avatarPatrick Boettcher <pb@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent fb51fd2d
...@@ -23,10 +23,11 @@ ...@@ -23,10 +23,11 @@
struct vp7045_fe_state { struct vp7045_fe_state {
struct dvb_frontend fe; struct dvb_frontend fe;
struct dvb_frontend_ops ops;
struct dvb_usb_device *d; struct dvb_usb_device *d;
}; };
static int vp7045_fe_read_status(struct dvb_frontend* fe, fe_status_t *status) static int vp7045_fe_read_status(struct dvb_frontend* fe, fe_status_t *status)
{ {
struct vp7045_fe_state *state = fe->demodulator_priv; struct vp7045_fe_state *state = fe->demodulator_priv;
...@@ -150,7 +151,8 @@ struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d) ...@@ -150,7 +151,8 @@ struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d)
goto error; goto error;
s->d = d; s->d = d;
s->fe.ops = &vp7045_fe_ops; memcpy(&s->ops, &vp7045_fe_ops, sizeof(struct dvb_frontend_ops));
s->fe.ops = &s->ops;
s->fe.demodulator_priv = s; s->fe.demodulator_priv = s;
goto success; goto success;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment