From: Douglas Schilling Landgraf Date: Wed, 12 Nov 2008 02:27:59 +0000 (-0300) Subject: V4L/DVB (9601): ttusb_dec: Add NULL pointer validation X-Git-Tag: v2.6.28-rc7~1^2~24 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=d7c31a1e754b5140eefeeb10c3c3be17f3702452;p=linux-2.6-omap-h63xx.git V4L/DVB (9601): ttusb_dec: Add NULL pointer validation Added validation for NULL pointer Signed-off-by: Douglas Schilling Landgraf Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c index ab33fec8a19..c1386e9b13d 100644 --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c @@ -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));