Skip to content

Commit 9a633f3

Browse files
Wei Yongjunstorulf
authored andcommitted
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 <[email protected]> Acked-by: Adrian Hunter <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent 451e319 commit 9a633f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mmc/host/sdhci-esdhc-imx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,8 +1500,8 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
15001500
if (imx_data->socdata->flags & ESDHC_FLAG_CQHCI) {
15011501
host->mmc->caps2 |= MMC_CAP2_CQE | MMC_CAP2_CQE_DCMD;
15021502
cq_host = devm_kzalloc(&pdev->dev, sizeof(*cq_host), GFP_KERNEL);
1503-
if (IS_ERR(cq_host)) {
1504-
err = PTR_ERR(cq_host);
1503+
if (!cq_host) {
1504+
err = -ENOMEM;
15051505
goto disable_ahb_clk;
15061506
}
15071507

0 commit comments

Comments
 (0)