crypto: aml-dma: fix errors found in coverity check

PD#168725: fix errors found in coverity check

Change-Id: I7528dc0c6122d32e3f2937a4b1869031d10851af
Signed-off-by: Matthew Shyu <matthew.shyu@amlogic.com>
This commit is contained in:
Matthew Shyu
2018-06-19 19:04:13 +08:00
committed by Yixun Lan
parent f669cda618
commit e9cdacdc34
3 changed files with 7 additions and 2 deletions

View File

@@ -988,6 +988,7 @@ static void aml_aes_done_task(unsigned long data)
if (!dd->in_sg || !dd->out_sg) {
pr_err("aml-aes: sg invalid\n");
err = -EINVAL;
break;
}
}
}

View File

@@ -124,6 +124,7 @@ static int aml_dma_probe(struct platform_device *pdev)
return err;
dma_err:
kfree(dma_dd);
dev_err(dev, "initialization failed.\n");
return err;

View File

@@ -777,10 +777,13 @@ static void aml_tdes_done_task(unsigned long data)
uint32_t i = 0;
for (i = 0; i < dd->fast_nents; i++) {
if (!dd->in_sg || !dd->out_sg)
err = -EINVAL;
dd->in_sg = sg_next(dd->in_sg);
dd->out_sg = sg_next(dd->out_sg);
if (!dd->in_sg || !dd->out_sg) {
pr_err("aml-tdes: sg invalid\n");
err = -EINVAL;
break;
}
}
}