summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2015-08-10 14:11:41 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-08-11 10:28:41 -0300
commit919db5c3199cbd7cf503cdc42f3467a524d1f9ff (patch)
treefc79359b0e784a7ca42ad3cb7982176a3dbe968d /drivers/media/pci
parent8e8a6b23f115906678252190c8fcf4168cc60fd5 (diff)
downloadlinux-919db5c3199cbd7cf503cdc42f3467a524d1f9ff.tar.gz
linux-919db5c3199cbd7cf503cdc42f3467a524d1f9ff.tar.bz2
linux-919db5c3199cbd7cf503cdc42f3467a524d1f9ff.zip
[media] mantis: Fix error handling in mantis_dma_init()
Current code assigns 0 to variable 'err', which makes mantis_dma_init() to return success even if mantis_alloc_buffers() fails. Fix it by checking the return value from mantis_alloc_buffers() and propagating it in the case of error. Reported-by: RUC_Soft_Sec <zy900702@163.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r--drivers/media/pci/mantis/mantis_dma.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/pci/mantis/mantis_dma.c b/drivers/media/pci/mantis/mantis_dma.c
index 1d59c7e039f7..87990ece5848 100644
--- a/drivers/media/pci/mantis/mantis_dma.c
+++ b/drivers/media/pci/mantis/mantis_dma.c
@@ -130,10 +130,11 @@ err:
int mantis_dma_init(struct mantis_pci *mantis)
{
- int err = 0;
+ int err;
dprintk(MANTIS_DEBUG, 1, "Mantis DMA init");
- if (mantis_alloc_buffers(mantis) < 0) {
+ err = mantis_alloc_buffers(mantis);
+ if (err < 0) {
dprintk(MANTIS_ERROR, 1, "Error allocating DMA buffer");
/* Stop RISC Engine */