summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Sands <duncan.sands@math.u\-psud.fr>2006-03-14 18:12:39 +0300
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-21 19:53:21 +0300
commit31dcbf994b9eda784c620c8caa3a9dc67a9d0045 (patch)
tree889d77d98d5584c7f90293344e56da62fd77a891
parentae24601b47c3f4a56545ef4cd4e7c821ac1db598 (diff)
downloadlinux-31dcbf994b9eda784c620c8caa3a9dc67a9d0045.tar.xz
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>
-rw-r--r--drivers/media/video/cx88/cx88-alsa.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
index 2acccd6d49bc..bffef1decc8b 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
@@ -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;
core = cx88_core_get(pci);
+ if (NULL == core) {
+ err = -EINVAL;
+ kfree (chip);
+ return err;
+ }
if (!pci_dma_supported(pci,0xffffffff)) {
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);
cx88_reset(core);
- if (NULL == core) {
- err = -EINVAL;
- kfree (chip);
- return err;
- }
chip->core = core;
/* get irq */