]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (9602): dvb-ttusb-budget: Add NULL pointer validation
authorDouglas Schilling Landgraf <dougsland@linuxtv.org>
Wed, 12 Nov 2008 02:30:49 +0000 (23:30 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 17 Nov 2008 01:54:35 +0000 (23:54 -0200)
Added validation for NULL pointer

Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c

index 66ab0c6e9783da4f8a99cca3699c3a32dd51ec58..5faeee3f70bf9e37fda33e4f2588aa12758981c5 100644 (file)
@@ -808,6 +808,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);