From: Gao Chao <gaochao49@xxxxxxxxxx> commit a8782f669c35 ("V4L/DVB (9796): drivers/media/video/cx88/cx88-alsa.c: Adjust error-handling code") added fail path. However, when cx88_core_get() returns null with chip->pci has not been setted, snd_cx88_dev_free() won't call a valid pci_disable_device() due to invalid chip->pci. Move the assignment of chip->pci forward to ensure snd_cx88_dev_free() can get valid chip->pci. Fixes: b7f355d23c34 ("V4L/DVB (3293): Added digital support for cx88 (cx88-alsa)") Signed-off-by: Gao Chao <gaochao49@xxxxxxxxxx> v2: - move the assignment of chip->pci after chip = card->private_data --- drivers/media/pci/cx88/cx88-alsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c index 29fb1311e443..22fe8c48a853 100644 --- a/drivers/media/pci/cx88/cx88-alsa.c +++ b/drivers/media/pci/cx88/cx88-alsa.c @@ -861,6 +861,7 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci, pci_set_master(pci); chip = card->private_data; + chip->pci = pci; core = cx88_core_get(pci); if (!core) { @@ -877,7 +878,6 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci, /* pci init */ chip->card = card; - chip->pci = pci; chip->irq = -1; spin_lock_init(&chip->reg_lock); -- 2.17.1