summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-02-28 06:48:49 +0100
committerAndy Gross <andy.gross@linaro.org>2019-03-28 05:32:26 +0100
commit93b260528020792032e50725383f27a27897bb0f (patch)
treebfe3de25efa01f6791b153fe9d6b0078b0826f87 /drivers/soc
parentsoc: qcom: qmi: Change txn wait to non-interruptible (diff)
downloadlinux-93b260528020792032e50725383f27a27897bb0f.tar.xz
linux-93b260528020792032e50725383f27a27897bb0f.zip
soc: qcom: cmd-db: Fix an error code in cmd_db_dev_probe()
The memremap() function doesn't return error pointers, it returns NULL. This code is returning "ret = PTR_ERR(NULL);" which is success, but it should return -ENOMEM. Fixes: 312416d9171a ("drivers: qcom: add command DB driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/qcom/cmd-db.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c
index c701b3b010f1..f6c3d17b05c7 100644
--- a/drivers/soc/qcom/cmd-db.c
+++ b/drivers/soc/qcom/cmd-db.c
@@ -248,8 +248,8 @@ static int cmd_db_dev_probe(struct platform_device *pdev)
}
cmd_db_header = memremap(rmem->base, rmem->size, MEMREMAP_WB);
- if (IS_ERR_OR_NULL(cmd_db_header)) {
- ret = PTR_ERR(cmd_db_header);
+ if (!cmd_db_header) {
+ ret = -ENOMEM;
cmd_db_header = NULL;
return ret;
}