public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
To: Md Sadre Alam <mdalam@codeaurora.org>,
	bjorn.andersson@linaro.org, adrian.hunter@intel.com,
	ulf.hansson@linaro.org, linux-arm-msm@vger.kernel.org,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: sricharan@codeaurora.org
Subject: Re: [PATCH] mmc: sdhci-msm: Fix possible NULL pointer exception
Date: Thu, 31 Dec 2020 12:11:52 +0530	[thread overview]
Message-ID: <9687f027-7a5d-2959-82fe-96e68d59c1ab@codeaurora.org> (raw)
In-Reply-To: <1608626913-16675-1-git-send-email-mdalam@codeaurora.org>


On 12/22/2020 2:18 PM, Md Sadre Alam wrote:
> of_device_get_match_data returns NULL when no match.
> So add the NULL pointer check to avoid dereference.
>
> Signed-off-by: Md Sadre Alam <mdalam@codeaurora.org>
> ---

Reviewed-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>

>   drivers/mmc/host/sdhci-msm.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
> index 9c7927b..f20e424 100644
> --- a/drivers/mmc/host/sdhci-msm.c
> +++ b/drivers/mmc/host/sdhci-msm.c
> @@ -2235,6 +2235,8 @@ static int sdhci_msm_probe(struct platform_device *pdev)
>   	 * the data associated with the version info.
>   	 */
>   	var_info = of_device_get_match_data(&pdev->dev);
> +	if (!var_info)
> +		goto pltfm_free;
>   
>   	msm_host->mci_removed = var_info->mci_removed;
>   	msm_host->restore_dll_config = var_info->restore_dll_config;

  reply	other threads:[~2020-12-31  6:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22  8:48 [PATCH] mmc: sdhci-msm: Fix possible NULL pointer exception Md Sadre Alam
2020-12-31  6:41 ` Veerabhadrarao Badiganti [this message]
2021-01-05 14:39 ` Adrian Hunter
2021-01-05 19:20 ` Bjorn Andersson

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=9687f027-7a5d-2959-82fe-96e68d59c1ab@codeaurora.org \
    --to=vbadigan@codeaurora.org \
    --cc=adrian.hunter@intel.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=mdalam@codeaurora.org \
    --cc=sricharan@codeaurora.org \
    --cc=ulf.hansson@linaro.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