Skip to content

Commit 17866bc

Browse files
Zhen Leivinodkoul
Zhen Lei
authored andcommitted
dmaengine: fsl-dpaa2-qdma: Fix error return code in two functions
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in the function where it is. Fixes: 7fdf9b0 ("dmaengine: fsl-dpaa2-qdma: Add NXP dpaa2 qDMA controller driver for Layerscape SoCs") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Zhen Lei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 077cdb3 commit 17866bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ static int __cold dpaa2_qdma_setup(struct fsl_mc_device *ls_dev)
332332
}
333333

334334
if (priv->dpdmai_attr.version.major > DPDMAI_VER_MAJOR) {
335+
err = -EINVAL;
335336
dev_err(dev, "DPDMAI major version mismatch\n"
336337
"Found %u.%u, supported version is %u.%u\n",
337338
priv->dpdmai_attr.version.major,
@@ -341,6 +342,7 @@ static int __cold dpaa2_qdma_setup(struct fsl_mc_device *ls_dev)
341342
}
342343

343344
if (priv->dpdmai_attr.version.minor > DPDMAI_VER_MINOR) {
345+
err = -EINVAL;
344346
dev_err(dev, "DPDMAI minor version mismatch\n"
345347
"Found %u.%u, supported version is %u.%u\n",
346348
priv->dpdmai_attr.version.major,
@@ -475,6 +477,7 @@ static int __cold dpaa2_qdma_dpio_setup(struct dpaa2_qdma_priv *priv)
475477
ppriv->store =
476478
dpaa2_io_store_create(DPAA2_QDMA_STORE_SIZE, dev);
477479
if (!ppriv->store) {
480+
err = -ENOMEM;
478481
dev_err(dev, "dpaa2_io_store_create() failed\n");
479482
goto err_store;
480483
}

0 commit comments

Comments
 (0)