提交 15a35ca6 编写于 作者: C Christophe JAILLET 提交者: Mauro Carvalho Chehab

[media] media: v4l2-pci-skeleton: Fix error handling path in 'skeleton_probe()'

If this memory allocation fails, we must release some resources, as
already done in the code below and above.
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 a8c779eb
...@@ -772,8 +772,10 @@ static int skeleton_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -772,8 +772,10 @@ static int skeleton_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* Allocate a new instance */ /* Allocate a new instance */
skel = devm_kzalloc(&pdev->dev, sizeof(struct skeleton), GFP_KERNEL); skel = devm_kzalloc(&pdev->dev, sizeof(struct skeleton), GFP_KERNEL);
if (!skel) if (!skel) {
return -ENOMEM; ret = -ENOMEM;
goto disable_pci;
}
/* Allocate the interrupt */ /* Allocate the interrupt */
ret = devm_request_irq(&pdev->dev, pdev->irq, ret = devm_request_irq(&pdev->dev, pdev->irq,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册