aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-02-01 08:35:22 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-08 07:45:24 -0500
commitadefdceef4c1cefee2678724cd57824c8ca80091 (patch)
tree6c3f48315f310980287a5acb8c1fd9d796547d10 /drivers
parent6339204ecc2aa2067a99595522de0403f0854bb8 (diff)
V4L/DVB: Fix the risk of an oops at dvb_dmx_release
dvb_dmx_init tries to allocate virtual memory for 2 pointers: filter and feed. If the second vmalloc fails, filter is freed, but the pointer keeps pointing to the old place. Later, when dvb_dmx_release() is called, it will try to free an already freed memory, causing an OOPS. Reviewed-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/dvb-core/dvb_demux.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c
index b78cfb7d1897..a78408e76e75 100644
--- a/drivers/media/dvb/dvb-core/dvb_demux.c
+++ b/drivers/media/dvb/dvb-core/dvb_demux.c
@@ -1246,6 +1246,7 @@ int dvb_dmx_init(struct dvb_demux *dvbdemux)
1246 dvbdemux->feed = vmalloc(dvbdemux->feednum * sizeof(struct dvb_demux_feed)); 1246 dvbdemux->feed = vmalloc(dvbdemux->feednum * sizeof(struct dvb_demux_feed));
1247 if (!dvbdemux->feed) { 1247 if (!dvbdemux->feed) {
1248 vfree(dvbdemux->filter); 1248 vfree(dvbdemux->filter);
1249 dvbdemux->filter = NULL;
1249 return -ENOMEM; 1250 return -ENOMEM;
1250 } 1251 }
1251 for (i = 0; i < dvbdemux->filternum; i++) { 1252 for (i = 0; i < dvbdemux->filternum; i++) {