mmc: dw_mmc: Remove struct dw_mci_slot
[ Sorry, a couple more. I should have included these in the same email ]
Hello Shawn Lin,
This is a semi-automatic email about new static checker warnings.
Commit 926311cf3361 ("mmc: dw_mmc: Remove struct dw_mci_slot") from Dec 16, 2025, leads to the following Smatch complaint:
drivers/mmc/host/dw_mmc.c:3494 dw_mci_runtime_suspend() warn: variable dereferenced before check 'host' (see line 3489) drivers/mmc/host/dw_mmc.c:3546 dw_mci_runtime_resume() warn: variable dereferenced before check 'host' (see line 3516) drivers/mmc/host/dw_mmc.c:3562 dw_mci_runtime_resume() warn: variable dereferenced before check 'host' (see line 3516)
drivers/mmc/host/dw_mmc.c
3488
3489 if (host->use_dma && host->dma_ops->exit)
^^^^^^
The host pointer is dereferenced
3490 host->dma_ops->exit(host);
3491
3492 clk_disable_unprepare(host->ciu_clk);
3493
3494 if (host &&
^^^^
So this check is too late.
3495 (mmc_host_can_gpio_cd(host->mmc) ||
3496 !mmc_card_is_removable(host->mmc)))
regards,
dan carpenter
Quoted 25 lines · Dan Carpenter
[ Sorry, a couple more. I should have included these in the same email ]
Hello Shawn Lin,
This is a semi-automatic email about new static checker warnings.
Commit
926311cf3361("mmc:dw_mmc: Remove structdw_mci_slot") from Dec 16, 2025, leads to the following Smatch complaint:
drivers/mmc/host/dw_mmc.c:3494dw_mci_runtime_suspend()warn: variable dereferenced before check 'host' (see line 3489)drivers/mmc/host/dw_mmc.c:3546dw_mci_runtime_resume()warn: variable dereferenced before check 'host' (see line 3516)drivers/mmc/host/dw_mmc.c:3562dw_mci_runtime_resume()warn: variable dereferenced before check 'host' (see line 3516)
drivers/mmc/host/dw_mmc.c
3488
3489 if (host->use_dma&&host->dma_ops->exit)^^^^^^The host pointer is dereferenced
3490
host->dma_ops->exit(host);
3491
3492clk_disable_unprepare(host->ciu_clk);
3493
3494 if (host &&
Quoted 9 lines
^^^^So this check is too late.
3495 (
mmc_host_can_gpio_cd(host->mmc)||
3496 !mmc_card_is_removable(host->mmc)))regards,
dan carpenter
Thanks for reporting Dan, the offending commit has just been dropped from my next branch.
Kind regards
Uffe