浏览代码

V4L/DVB (9601): ttusb_dec: Add NULL pointer validation

Added validation for NULL pointer

Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Douglas Schilling Landgraf 16 年之前
父节点
当前提交
d7c31a1e75
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      drivers/media/dvb/ttusb-dec/ttusb_dec.c

+ 6 - 0
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));