Commit b09a79f5 authored by Trent Piepho's avatar Trent Piepho Committed by Mauro Carvalho Chehab

V4L/DVB (6020): cx88: Fix use of uninitialized variable

An error message for PCI resource allocation failure used the board type
before it was set.  Just get rid of the error message, as get_ressources()
[sic] already prints one.  Format that error message better, and add the pci
function and subsystem information to better associate the error with what
caused it.
Signed-off-by: default avatarTrent Piepho <xyzzy@speakeasy.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent c252b051
...@@ -1077,8 +1077,11 @@ static int get_ressources(struct cx88_core *core, struct pci_dev *pci) ...@@ -1077,8 +1077,11 @@ static int get_ressources(struct cx88_core *core, struct pci_dev *pci)
pci_resource_len(pci,0), pci_resource_len(pci,0),
core->name)) core->name))
return 0; return 0;
printk(KERN_ERR "%s: can't get MMIO memory @ 0x%llx\n", printk(KERN_ERR
core->name,(unsigned long long)pci_resource_start(pci,0)); "%s/%d: Can't get MMIO memory @ 0x%llx, subsystem: %04x:%04x\n",
core->name, PCI_FUNC(pci->devfn),
(unsigned long long)pci_resource_start(pci, 0),
pci->subsystem_vendor, pci->subsystem_device);
return -EBUSY; return -EBUSY;
} }
...@@ -1115,12 +1118,6 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci) ...@@ -1115,12 +1118,6 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci)
core->nr = cx88_devcount++; core->nr = cx88_devcount++;
sprintf(core->name,"cx88[%d]",core->nr); sprintf(core->name,"cx88[%d]",core->nr);
if (0 != get_ressources(core,pci)) { if (0 != get_ressources(core,pci)) {
printk(KERN_ERR "CORE %s No more PCI ressources for "
"subsystem: %04x:%04x, board: %s\n",
core->name,pci->subsystem_vendor,
pci->subsystem_device,
cx88_boards[core->board].name);
cx88_devcount--; cx88_devcount--;
goto fail_free; goto fail_free;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment