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: <YRu/x+KBHtl3jg3T@orome.fritz.box>
Date:   Tue, 17 Aug 2021 15:55:19 +0200
From:   Thierry Reding <thierry.reding@...il.com>
To:     Aakash Hemadri <aakashhemadri123@...il.com>
Cc:     Mark Brown <broonie@...nel.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        alsa-devel@...a-project.org, linux-tegra@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Shuah Khan <skhan@...uxfoundation.org>,
        Bjorn Helgaas <bjorn@...gaas.com>
Subject: Re: [PATCH 1/2] ASoC: tegra30: ahub: Fix incorrect usage of
 of_device_get_match_data

On Tue, Aug 17, 2021 at 02:44:51AM +0530, Aakash Hemadri wrote:
> const struct of_device_id incorrectly assigned "match->data" using
> of_device_get_match_data()
> 
> Instead assign `const struct tegra30_ahub_soc_data *soc_data` with
> const void *of_device_get_match_data(...)
> 
> Fixes: 80165bb80433 ("ASoC: tegra30: ahub: Use of_device_get_match_data")
> 
> Signed-off-by: Aakash Hemadri <aakashhemadri123@...il.com>
> ---
>  sound/soc/tegra/tegra30_ahub.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c
> index 0ac109b32329..ef011a488ceb 100644
> --- a/sound/soc/tegra/tegra30_ahub.c
> +++ b/sound/soc/tegra/tegra30_ahub.c
> @@ -512,16 +512,14 @@ static const struct of_device_id tegra30_ahub_of_match[] = {
>  
>  static int tegra30_ahub_probe(struct platform_device *pdev)
>  {
> -	const struct of_device_id *match;
>  	const struct tegra30_ahub_soc_data *soc_data;
>  	struct resource *res0;
>  	void __iomem *regs_apbif, *regs_ahub;
>  	int ret = 0;
>  
> -	match = of_device_get_match_data(&pdev->dev);
> -	if (!match)
> +	soc_data = of_device_get_match_data(&pdev->dev);
> +	if (!soc_data)
>  		return -EINVAL;
> -	soc_data = match->data;

Minor nit: !soc_data can actually never happen for this driver. First,
tegra30_ahub_probe() will only ever be called if there was a match with
an entry from the OF device ID table, and then all entries have .data
set to a valid point.

It's a pre-existing issue, but since all of the surrounding code is
already getting updated, perhaps it'd be a good idea to fix that up
while at it.

Thierry

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ