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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220209190701.GA10459@duo.ucw.cz>
Date:   Wed, 9 Feb 2022 20:07:01 +0100
From:   Pavel Machek <pavel@...x.de>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Miaoqian Lin <linmq006@...il.com>,
        Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH 4.19 77/86] ASoC: fsl: Add missing error handling in
 pcm030_fabric_probe

Hi!

> commit fb25621da5702c104ce0a48de5b174ced09e5b4e upstream.
> 
> Add the missing platform_device_put() and platform_device_del()
> before return from pcm030_fabric_probe in the error handling case.

Are you sure?

> --- a/sound/soc/fsl/pcm030-audio-fabric.c
> +++ b/sound/soc/fsl/pcm030-audio-fabric.c
> @@ -90,16 +90,21 @@ static int pcm030_fabric_probe(struct pl
>  		dev_err(&op->dev, "platform_device_alloc() failed\n");
>  
>  	ret = platform_device_add(pdata->codec_device);
> -	if (ret)
> +	if (ret) {
>  		dev_err(&op->dev, "platform_device_add() failed: %d\n", ret);
> +		platform_device_put(pdata->codec_device);
> +	}
>  
>  	ret = snd_soc_register_card(card);
> -	if (ret)
> +	if (ret) {
>  		dev_err(&op->dev, "snd_soc_register_card() failed: %d\n", ret);
> +		platform_device_del(pdata->codec_device);
> +		platform_device_put(pdata->codec_device);
> +	}
>  
>  	platform_set_drvdata(op, pdata);
> -
>  	return ret;
> +
>  }

Besides interesting whitespace, this will happily do
platform_device_put() twice. I suspect it should return or
something. This does not look right.

Best regards,
							Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ