提交 417c1138 编写于 作者: C Christophe JAILLET 提交者: Yang Yingliang

media: cx88: Fix some error handling path in 'cx8800_initdev()'

[ Upstream commit e1444e9b0424c70def6352580762d660af50e03f ]

A call to 'pci_disable_device()' is missing in the error handling path.
In some cases, a call to 'free_irq()' may also be missing.

Reorder the error handling path, add some new labels and fix the 2 issues
mentionned above.

This way, the error handling path in more in line with 'cx8800_finidev()'
(i.e. the remove function)
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 e62c9eaf
...@@ -1312,7 +1312,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev, ...@@ -1312,7 +1312,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
core = cx88_core_get(dev->pci); core = cx88_core_get(dev->pci);
if (!core) { if (!core) {
err = -EINVAL; err = -EINVAL;
goto fail_free; goto fail_disable;
} }
dev->core = core; dev->core = core;
...@@ -1358,7 +1358,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev, ...@@ -1358,7 +1358,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
cc->step, cc->default_value); cc->step, cc->default_value);
if (!vc) { if (!vc) {
err = core->audio_hdl.error; err = core->audio_hdl.error;
goto fail_core; goto fail_irq;
} }
vc->priv = (void *)cc; vc->priv = (void *)cc;
} }
...@@ -1372,7 +1372,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev, ...@@ -1372,7 +1372,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
cc->step, cc->default_value); cc->step, cc->default_value);
if (!vc) { if (!vc) {
err = core->video_hdl.error; err = core->video_hdl.error;
goto fail_core; goto fail_irq;
} }
vc->priv = (void *)cc; vc->priv = (void *)cc;
if (vc->id == V4L2_CID_CHROMA_AGC) if (vc->id == V4L2_CID_CHROMA_AGC)
...@@ -1535,11 +1535,14 @@ static int cx8800_initdev(struct pci_dev *pci_dev, ...@@ -1535,11 +1535,14 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
fail_unreg: fail_unreg:
cx8800_unregister_video(dev); cx8800_unregister_video(dev);
free_irq(pci_dev->irq, dev);
mutex_unlock(&core->lock); mutex_unlock(&core->lock);
fail_irq:
free_irq(pci_dev->irq, dev);
fail_core: fail_core:
core->v4ldev = NULL; core->v4ldev = NULL;
cx88_core_put(core, dev->pci); cx88_core_put(core, dev->pci);
fail_disable:
pci_disable_device(pci_dev);
fail_free: fail_free:
kfree(dev); kfree(dev);
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册