diff options
author | Christian Engelmayer <cengelma@gmx.at> | 2015-02-14 18:12:56 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-03-02 12:47:19 -0500 |
commit | 96df988bb935959e6380c2333e03911839079ee1 (patch) | |
tree | 04458e4958815c746886bb8b37d2217524a3fbc6 /drivers/media/pci | |
parent | 2160abb2945831aaf50d176ef6d070bdbd19130d (diff) |
[media] cx88: Fix possible leak in cx8802_probe()
In case allocation vb2_dma_sg_init_ctx() fails during cx8802_probe(), the
already allocated cx8802 device structure memory is not freed in the used
exit path. Thus adapt the cleanup handling accordingly. Detected by Coverity
CID 1260065.
Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r-- | drivers/media/pci/cx88/cx88-mpeg.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/pci/cx88/cx88-mpeg.c b/drivers/media/pci/cx88/cx88-mpeg.c index a369b0840acf..98344540c51f 100644 --- a/drivers/media/pci/cx88/cx88-mpeg.c +++ b/drivers/media/pci/cx88/cx88-mpeg.c | |||
@@ -732,7 +732,7 @@ static int cx8802_probe(struct pci_dev *pci_dev, | |||
732 | dev->alloc_ctx = vb2_dma_sg_init_ctx(&pci_dev->dev); | 732 | dev->alloc_ctx = vb2_dma_sg_init_ctx(&pci_dev->dev); |
733 | if (IS_ERR(dev->alloc_ctx)) { | 733 | if (IS_ERR(dev->alloc_ctx)) { |
734 | err = PTR_ERR(dev->alloc_ctx); | 734 | err = PTR_ERR(dev->alloc_ctx); |
735 | goto fail_core; | 735 | goto fail_dev; |
736 | } | 736 | } |
737 | dev->core = core; | 737 | dev->core = core; |
738 | 738 | ||
@@ -754,6 +754,7 @@ static int cx8802_probe(struct pci_dev *pci_dev, | |||
754 | 754 | ||
755 | fail_free: | 755 | fail_free: |
756 | vb2_dma_sg_cleanup_ctx(dev->alloc_ctx); | 756 | vb2_dma_sg_cleanup_ctx(dev->alloc_ctx); |
757 | fail_dev: | ||
757 | kfree(dev); | 758 | kfree(dev); |
758 | fail_core: | 759 | fail_core: |
759 | core->dvbdev = NULL; | 760 | core->dvbdev = NULL; |