All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>,
	linux-mmc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH 1/7] mmc: sdhci-pltfm: bail out if register resource is too small
Date: Tue, 19 Apr 2016 14:32:36 +0300	[thread overview]
Message-ID: <57161754.5050303@intel.com> (raw)
In-Reply-To: <1460600990-10993-2-git-send-email-yamada.masahiro@socionext.com>

On 14/04/16 05:29, Masahiro Yamada wrote:
> This code checks the resource size and displays an error message if
> it is too small, but still moves forward.  Let is fail in that case.

is -> it

How do you know there aren't drivers that actually have a smaller size?

One that might not is sdhci-dove which appears to sidestep some registers in
sdhci_dove_readw().


> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  drivers/mmc/host/sdhci-pltfm.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
> index 072bb27..7d12203 100644
> --- a/drivers/mmc/host/sdhci-pltfm.c
> +++ b/drivers/mmc/host/sdhci-pltfm.c
> @@ -127,8 +127,11 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
>  		goto err;
>  	}
>  
> -	if (resource_size(iomem) < 0x100)
> +	if (resource_size(iomem) < 0x100) {
>  		dev_err(&pdev->dev, "Invalid iomem size!\n");
> +		ret = -EINVAL;
> +		goto err;
> +	}
>  
>  	host = sdhci_alloc_host(&pdev->dev,
>  		sizeof(struct sdhci_pltfm_host) + priv_size);
> 


  reply	other threads:[~2016-04-19 11:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14  2:29 [PATCH 0/7] mmc: sdhci-pltfm: fix and tidy up sdhci_pltfm_init() Masahiro Yamada
2016-04-14  2:29 ` [PATCH 1/7] mmc: sdhci-pltfm: bail out if register resource is too small Masahiro Yamada
2016-04-19 11:32   ` Adrian Hunter [this message]
2016-04-19 11:46     ` Masahiro Yamada
2016-04-19 13:28       ` Adrian Hunter
2016-04-14  2:29 ` [PATCH 2/7] mmc: sdhci-pltfm: check return value of platform_get_irq() Masahiro Yamada
2016-04-14  2:29 ` [PATCH 3/7] mmc: sdhci-pltfm: use devm_request_mem_region() Masahiro Yamada
2016-04-14  2:29 ` [PATCH 4/7] mmc: sdhci-pltfm: use devm_ioremap() Masahiro Yamada
2016-04-14  2:29 ` [PATCH 5/7] mmc: sdhci-pltfm: use devm_ioremap_resource() Masahiro Yamada
2016-04-14  2:29 ` [PATCH 6/7] mmc: sdhci-pltfm: move devm_ioremap_resource() up Masahiro Yamada
2016-04-14  2:29 ` [PATCH 7/7] mmc: sdhci-pltfm: call platform_get_irq() before sdhci_alloc_host() Masahiro Yamada

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=57161754.5050303@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=yamada.masahiro@socionext.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.