Skip to content

Commit 411ea67

Browse files
committed
Merge tag 'mmc-v5.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC fixes from Ulf Hansson: "MMC core: - Fix use-after-free issue for rpmb partition MMC host: - Fix quirk for broken CQE support" * tag 'mmc-v5.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: block: Fix use-after-free issue for rpmb mmc: sdhci: Fix SDHCI_QUIRK_BROKEN_CQE
2 parents d54b64e + 202500d commit 411ea67

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

drivers/mmc/core/block.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2484,8 +2484,8 @@ static int mmc_rpmb_chrdev_release(struct inode *inode, struct file *filp)
24842484
struct mmc_rpmb_data *rpmb = container_of(inode->i_cdev,
24852485
struct mmc_rpmb_data, chrdev);
24862486

2487-
put_device(&rpmb->dev);
24882487
mmc_blk_put(rpmb->md);
2488+
put_device(&rpmb->dev);
24892489

24902490
return 0;
24912491
}

drivers/mmc/host/sdhci.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4000,9 +4000,6 @@ int sdhci_setup_host(struct sdhci_host *host)
40004000
mmc_hostname(mmc), host->version);
40014001
}
40024002

4003-
if (host->quirks & SDHCI_QUIRK_BROKEN_CQE)
4004-
mmc->caps2 &= ~MMC_CAP2_CQE;
4005-
40064003
if (host->quirks & SDHCI_QUIRK_FORCE_DMA)
40074004
host->flags |= SDHCI_USE_SDMA;
40084005
else if (!(host->caps & SDHCI_CAN_DO_SDMA))
@@ -4539,6 +4536,12 @@ int __sdhci_add_host(struct sdhci_host *host)
45394536
struct mmc_host *mmc = host->mmc;
45404537
int ret;
45414538

4539+
if ((mmc->caps2 & MMC_CAP2_CQE) &&
4540+
(host->quirks & SDHCI_QUIRK_BROKEN_CQE)) {
4541+
mmc->caps2 &= ~MMC_CAP2_CQE;
4542+
mmc->cqe_ops = NULL;
4543+
}
4544+
45424545
host->complete_wq = alloc_workqueue("sdhci", flags, 0);
45434546
if (!host->complete_wq)
45444547
return -ENOMEM;

0 commit comments

Comments
 (0)