aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/firesat/firesat-ci.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/media/dvb/firesat/firesat-ci.c b/drivers/media/dvb/firesat/firesat-ci.c
index 0deb47eefa10..783ed2000102 100644
--- a/drivers/media/dvb/firesat/firesat-ci.c
+++ b/drivers/media/dvb/firesat/firesat-ci.c
@@ -127,14 +127,20 @@ static int firesat_ca_pmt(struct firesat *firesat, void *arg)
127{ 127{
128 struct ca_msg *msg = arg; 128 struct ca_msg *msg = arg;
129 int data_pos; 129 int data_pos;
130 int data_length;
131 int i;
132
133 data_pos = 4;
134 if (msg->msg[3] & 0x80) {
135 data_length = 0;
136 for (i = 0; i < (msg->msg[3] & 0x7F); i++)
137 data_length = (data_length << 8) + msg->msg[data_pos++];
138 } else {
139 data_length = msg->msg[3];
140 }
130 141
131 if (msg->msg[3] & 0x80) 142 return avc_ca_pmt(firesat, &msg->msg[data_pos], data_length) ?
132 data_pos = (msg->msg[4] && 0x7F) + 4; 143 -EFAULT : 0;
133 else
134 data_pos = 4;
135
136 return avc_ca_pmt(firesat, &msg->msg[data_pos],
137 msg->length - data_pos) ? -EFAULT : 0;
138} 144}
139 145
140static int firesat_ca_send_msg(struct firesat *firesat, void *arg) 146static int firesat_ca_send_msg(struct firesat *firesat, void *arg)