From: Jaehoon Chung <jh80.chung@samsung.com>
To: Wen Zhiwei <wenzhiwei@kylinos.cn>,
ulf.hansson@linaro.org, p.zabel@pengutronix.de
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc: dw_mmc: Fix potential null pointer risk
Date: Thu, 30 Dec 2021 17:35:32 +0900 [thread overview]
Message-ID: <beeb83e9-415c-cf36-9cec-f9bc277442ed@samsung.com> (raw)
In-Reply-To: <20211229023814.53372-1-wenzhiwei@kylinos.cn>
On 12/29/21 11:38 AM, Wen Zhiwei wrote:
> we previously assumed 'host->slot' could be null,
> null pointer judgment should be added
>
> Signed-off-by: Wen Zhiwei <wenzhiwei@kylinos.cn>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Beset Regards,
Jaehoon Chung
> ---
> drivers/mmc/host/dw_mmc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index d977f34f6b55..c9dc8c168efb 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -3518,7 +3518,7 @@ int dw_mci_runtime_resume(struct device *dev)
> mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE);
>
>
> - if (host->slot->mmc->pm_flags & MMC_PM_KEEP_POWER)
> + if (host->slot && host->slot->mmc->pm_flags & MMC_PM_KEEP_POWER)
> dw_mci_set_ios(host->slot->mmc, &host->slot->mmc->ios);
>
> /* Force setup bus to guarantee available clock output */
>
next prev parent reply other threads:[~2021-12-30 8:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20211229023827epcas1p1c62596be323776d0abad266224c299e0@epcas1p1.samsung.com>
2021-12-29 2:38 ` Wen Zhiwei
2021-12-30 8:35 ` Jaehoon Chung [this message]
2022-01-24 14:40 ` Ulf Hansson
2024-03-07 8:51 Aleksandr Mishin
2024-03-07 10:57 ` Ulf Hansson
2024-03-07 19:02 ` Aleksandr Mishin
2024-03-12 11:29 ` Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=beeb83e9-415c-cf36-9cec-f9bc277442ed@samsung.com \
--to=jh80.chung@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=ulf.hansson@linaro.org \
--cc=wenzhiwei@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®