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: 312416d917 ("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>
This commit is contained in:
Dan Carpenter 2019-02-28 08:48:49 +03:00 коммит произвёл Andy Gross
Родитель 9324df5817
Коммит 93b2605280
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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;
}