diff options
| -rw-r--r-- | drivers/media/dvb/dvb-core/dvb_demux.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c index a78408e76e75..67f189b7aa1f 100644 --- a/drivers/media/dvb/dvb-core/dvb_demux.c +++ b/drivers/media/dvb/dvb-core/dvb_demux.c | |||
| @@ -426,16 +426,7 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf) | |||
| 426 | }; | 426 | }; |
| 427 | }; | 427 | }; |
| 428 | 428 | ||
| 429 | if (dvb_demux_tscheck) { | 429 | if (demux->cnt_storage) { |
| 430 | if (!demux->cnt_storage) | ||
| 431 | demux->cnt_storage = vmalloc(MAX_PID + 1); | ||
| 432 | |||
| 433 | if (!demux->cnt_storage) { | ||
| 434 | printk(KERN_WARNING "Couldn't allocate memory for TS/TEI check. Disabling it\n"); | ||
| 435 | dvb_demux_tscheck = 0; | ||
| 436 | goto no_dvb_demux_tscheck; | ||
| 437 | } | ||
| 438 | |||
| 439 | /* check pkt counter */ | 430 | /* check pkt counter */ |
| 440 | if (pid < MAX_PID) { | 431 | if (pid < MAX_PID) { |
| 441 | if (buf[1] & 0x80) | 432 | if (buf[1] & 0x80) |
| @@ -454,7 +445,6 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf) | |||
| 454 | }; | 445 | }; |
| 455 | /* end check */ | 446 | /* end check */ |
| 456 | }; | 447 | }; |
| 457 | no_dvb_demux_tscheck: | ||
| 458 | 448 | ||
| 459 | list_for_each_entry(feed, &demux->feed_list, list_head) { | 449 | list_for_each_entry(feed, &demux->feed_list, list_head) { |
| 460 | if ((feed->pid != pid) && (feed->pid != 0x2000)) | 450 | if ((feed->pid != pid) && (feed->pid != 0x2000)) |
| @@ -1258,6 +1248,13 @@ int dvb_dmx_init(struct dvb_demux *dvbdemux) | |||
| 1258 | dvbdemux->feed[i].index = i; | 1248 | dvbdemux->feed[i].index = i; |
| 1259 | } | 1249 | } |
| 1260 | 1250 | ||
| 1251 | if (dvb_demux_tscheck) { | ||
| 1252 | dvbdemux->cnt_storage = vmalloc(MAX_PID + 1); | ||
| 1253 | |||
| 1254 | if (!dvbdemux->cnt_storage) | ||
| 1255 | printk(KERN_WARNING "Couldn't allocate memory for TS/TEI check. Disabling it\n"); | ||
| 1256 | } | ||
| 1257 | |||
| 1261 | INIT_LIST_HEAD(&dvbdemux->frontend_list); | 1258 | INIT_LIST_HEAD(&dvbdemux->frontend_list); |
| 1262 | 1259 | ||
| 1263 | for (i = 0; i < DMX_TS_PES_OTHER; i++) { | 1260 | for (i = 0; i < DMX_TS_PES_OTHER; i++) { |
