diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2019-01-16 05:44:51 +0000 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2019-02-25 08:40:58 +0100 |
commit | 9a633f3bfb9784fe4d12c0349e9d887e36b4a9e0 (patch) | |
tree | 66730709f5b15afa14c22973443194dec1881a0f /drivers/mmc/host/sdhci-esdhc-imx.c | |
parent | 451e31935d897689b67bfd3d772af72418f6b4ce (diff) | |
download | linux-9a633f3bfb9784fe4d12c0349e9d887e36b4a9e0.tar.gz linux-9a633f3bfb9784fe4d12c0349e9d887e36b4a9e0.tar.bz2 linux-9a633f3bfb9784fe4d12c0349e9d887e36b4a9e0.zip |
mmc: sdhci-esdhc-imx: fix return value check in sdhci_esdhc_imx_probe()
In case of error, the function devm_kzalloc() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.
Fixes: fadac7488064 ("mmc: sdhci-esdhc-imx: add CMDQ support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-esdhc-imx.c')
-rw-r--r-- | drivers/mmc/host/sdhci-esdhc-imx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 75ad824dd602..fad600739d0e 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1500,8 +1500,8 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) if (imx_data->socdata->flags & ESDHC_FLAG_CQHCI) { host->mmc->caps2 |= MMC_CAP2_CQE | MMC_CAP2_CQE_DCMD; cq_host = devm_kzalloc(&pdev->dev, sizeof(*cq_host), GFP_KERNEL); - if (IS_ERR(cq_host)) { - err = PTR_ERR(cq_host); + if (!cq_host) { + err = -ENOMEM; goto disable_ahb_clk; } |