]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (9601): ttusb_dec: Add NULL pointer validation
authorDouglas Schilling Landgraf <dougsland@linuxtv.org>
Wed, 12 Nov 2008 02:27:59 +0000 (23:27 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 17 Nov 2008 01:54:29 +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-dec/ttusb_dec.c

index ab33fec8a19fbcef75855786f5dadc44c2bf721f..c1386e9b13d357d1814d3e98037bfe6b27bbf29c 100644 (file)
@@ -1157,6 +1157,12 @@ static int ttusb_dec_alloc_iso_urbs(struct ttusb_dec *dec)
                                                ISO_BUF_COUNT),
                                               &dec->iso_dma_handle);
 
+       if (!dec->iso_buffer) {
+               dprintk("%s: pci_alloc_consistent - not enough memory\n",
+                       __func__);
+               return -ENOMEM;
+       }
+
        memset(dec->iso_buffer, 0,
               ISO_FRAME_SIZE * (FRAMES_PER_ISO_BUF * ISO_BUF_COUNT));