提交 919db5c3 编写于 作者: F Fabio Estevam 提交者: Mauro Carvalho Chehab

[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: NRUC_Soft_Sec <zy900702@163.com>
Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 8e8a6b23
......@@ -130,10 +130,11 @@ static inline int mantis_alloc_buffers(struct mantis_pci *mantis)
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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册