From: Peter Korsgaard <peter-+2lRwdCCLRT2eFz/2MeuCQ@public.gmane.org>
To: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
=Ulf Hansson
<ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] mmc: android-goldfish: fix potential panic due to null pointer
Date: Mon, 22 Aug 2016 14:33:01 +0200 [thread overview]
Message-ID: <87bn0lrnk2.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <1471750476-335-1-git-send-email-shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org> (Shawn Lin's message of "Sun, 21 Aug 2016 11:34:36 +0800")
>>>>> "Shawn" == Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org> writes:
> We should never compare virt_base with zero to indicate whether
> we get the right buffer or not from dma_alloc_coherent. It's quite
> architecture related. If failing to get the address from CMA or swoitlb
> cases, the sub architecture code should decide the return value for it.
> So we should never presume that zero always means the failure.
> Signed-off-by: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> ---
> drivers/mmc/host/android-goldfish.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/drivers/mmc/host/android-goldfish.c b/drivers/mmc/host/android-goldfish.c
> index dca5518..6d8bd03 100644
> --- a/drivers/mmc/host/android-goldfish.c
> +++ b/drivers/mmc/host/android-goldfish.c
> @@ -484,7 +484,7 @@ static int goldfish_mmc_probe(struct platform_device *pdev)
host-> virt_base = dma_alloc_coherent(&pdev->dev, BUFFER_SIZE,
> &buf_addr, GFP_KERNEL);
> - if (host->virt_base == 0) {
> + if (!host->virt_base) {
Huh, these are equivalent?
--
Bye, Peter Korsgaard
prev parent reply other threads:[~2016-08-22 12:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-21 3:34 [PATCH] mmc: android-goldfish: fix potential panic due to null pointer Shawn Lin
[not found] ` <1471750476-335-1-git-send-email-shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-08-22 12:33 ` Peter Korsgaard [this message]
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=87bn0lrnk2.fsf@dell.be.48ers.dk \
--to=peter-+2lrwdcclrt2efz/2meucq@public.gmane.org \
--cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
/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