提交 fbc0ae20 编写于 作者: A Alan Cox 提交者: Mauro Carvalho Chehab

V4L/DVB (11243): cx88: Missing failure checks

The ioremap one was reported in October 2007 (Bug 9146), the kmalloc one
was blindingly obvious while looking at the ioremap one

The bug suggests some other configuration for lots of I/O memory (32MB per
device is ioremapped) but I'll leave that to the real maintainers
Signed-off-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 c01f1a5a
......@@ -3127,6 +3127,8 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
int i;
core = kzalloc(sizeof(*core), GFP_KERNEL);
if (core == NULL)
return NULL;
atomic_inc(&core->refcount);
core->pci_bus = pci->bus->number;
......@@ -3157,6 +3159,11 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
pci_resource_len(pci, 0));
core->bmmio = (u8 __iomem *)core->lmmio;
if (core->lmmio == NULL) {
kfree(core);
return NULL;
}
/* board config */
core->boardnr = UNSET;
if (card[core->nr] < ARRAY_SIZE(cx88_boards))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册