lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e502c03a-3ac4-b660-40d5-944d52a31655@intel.com>
Date:   Thu, 12 May 2022 14:47:56 +0300
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@...inx.com>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Michal Simek <michal.simek@...inx.com>
Cc:     linux-kernel@...r.kernel.org, linux-mmc@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, git@...inx.com,
        saikrishna12468@...il.com, sgoud@...inx.com
Subject: Re: [PATCH] mmc: sdhci-of-arasan: Add NULL check for data field

On 12/05/22 10:19, Sai Krishna Potthuri wrote:
> Add NULL check for data field retrieved from of_device_get_match_data()
> before dereferencing the data.
> Addresses-coverity: CID 305057:Dereference null return value (NULL_RETURNS)
> 
> Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@...inx.com>

Acked-by: Adrian Hunter <adrian.hunter@...el.com>

> ---
>  drivers/mmc/host/sdhci-of-arasan.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
> index 6a2e5a468424..757801dfc308 100644
> --- a/drivers/mmc/host/sdhci-of-arasan.c
> +++ b/drivers/mmc/host/sdhci-of-arasan.c
> @@ -1577,6 +1577,9 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
>  	const struct sdhci_arasan_of_data *data;
>  
>  	data = of_device_get_match_data(dev);
> +	if (!data)
> +		return -EINVAL;
> +
>  	host = sdhci_pltfm_init(pdev, data->pdata, sizeof(*sdhci_arasan));
>  
>  	if (IS_ERR(host))

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ