From be08890b0323e39e6026b00048343971e10033a9 Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Wed, 12 Nov 2008 00:30:49 -0200 Subject: dvb-ttusb-budget: Add NULL pointer validation From: Douglas Schilling Landgraf Added validation for NULL pointer Priority: high Signed-off-by: Douglas Schilling Landgraf --- linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index 13085a8e2..9271e2366 100644 --- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c @@ -828,6 +828,12 @@ static int ttusb_alloc_iso_urbs(struct ttusb *ttusb) ISO_BUF_COUNT, &ttusb->iso_dma_handle); + if (!ttusb->iso_buffer) { + dprintk("%s: pci_alloc_consistent - not enough memory\n", + __func__); + return -ENOMEM; + } + memset(ttusb->iso_buffer, 0, ISO_FRAME_SIZE * FRAMES_PER_ISO_BUF * ISO_BUF_COUNT); -- cgit v1.2.3