mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-12 11:36:35 +00:00
V4L/DVB (3488): Snd_cx88_create: don't dereference NULL core
If the call to cx88_core_get returns a NULL value, it is dereferenced by cx88_reset, and perhaps by cx88_core_put. Spotted by the Coverity checker. Signed-off-by: Duncan Sands <baldrick@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
ae24601b47
commit
31dcbf994b
1 changed files with 5 additions and 5 deletions
|
@ -672,6 +672,11 @@ static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci,
|
||||||
chip = (snd_cx88_card_t *) card->private_data;
|
chip = (snd_cx88_card_t *) card->private_data;
|
||||||
|
|
||||||
core = cx88_core_get(pci);
|
core = cx88_core_get(pci);
|
||||||
|
if (NULL == core) {
|
||||||
|
err = -EINVAL;
|
||||||
|
kfree (chip);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
if (!pci_dma_supported(pci,0xffffffff)) {
|
if (!pci_dma_supported(pci,0xffffffff)) {
|
||||||
dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
|
dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
|
||||||
|
@ -688,11 +693,6 @@ static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci,
|
||||||
spin_lock_init(&chip->reg_lock);
|
spin_lock_init(&chip->reg_lock);
|
||||||
|
|
||||||
cx88_reset(core);
|
cx88_reset(core);
|
||||||
if (NULL == core) {
|
|
||||||
err = -EINVAL;
|
|
||||||
kfree (chip);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
chip->core = core;
|
chip->core = core;
|
||||||
|
|
||||||
/* get irq */
|
/* get irq */
|
||||||
|
|
Loading…
Reference in a new issue