提交 d7c31a1e 编写于 作者: D Douglas Schilling Landgraf 提交者: Mauro Carvalho Chehab

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

Added validation for NULL pointer
Signed-off-by: NDouglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 e14c8bf8
...@@ -1157,6 +1157,12 @@ static int ttusb_dec_alloc_iso_urbs(struct ttusb_dec *dec) ...@@ -1157,6 +1157,12 @@ static int ttusb_dec_alloc_iso_urbs(struct ttusb_dec *dec)
ISO_BUF_COUNT), ISO_BUF_COUNT),
&dec->iso_dma_handle); &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, memset(dec->iso_buffer, 0,
ISO_FRAME_SIZE * (FRAMES_PER_ISO_BUF * ISO_BUF_COUNT)); ISO_FRAME_SIZE * (FRAMES_PER_ISO_BUF * ISO_BUF_COUNT));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册