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] [day] [month] [year] [list]
Message-ID: <Y2ByHKkX8mHJK7EL@kernel.org>
Date:   Tue, 1 Nov 2022 03:10:52 +0200
From:   Jarkko Sakkinen <jarkko@...nel.org>
To:     Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:     Peter Huewe <peterhuewe@....de>, Jason Gunthorpe <jgg@...pe.ca>,
        linux-integrity@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 3/3] tpm: st33zp24: remove pointless checks on probe

On Thu, Oct 27, 2022 at 12:13:49AM -0700, Dmitry Torokhov wrote:
> Remove tests for SPI device or I2C client to be non-NULL because
> driver core will never call driver's probe method without having
> a valid device structure.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
> ---
> 
> v3: no changes
> v2: reworked commit message
> 
>  drivers/char/tpm/st33zp24/i2c.c | 6 ------
>  drivers/char/tpm/st33zp24/spi.c | 7 -------
>  2 files changed, 13 deletions(-)
> 
> diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c
> index 614c7d8ed84f..8156bb2af78c 100644
> --- a/drivers/char/tpm/st33zp24/i2c.c
> +++ b/drivers/char/tpm/st33zp24/i2c.c
> @@ -106,12 +106,6 @@ static int st33zp24_i2c_probe(struct i2c_client *client,
>  {
>  	struct st33zp24_i2c_phy *phy;
>  
> -	if (!client) {
> -		pr_info("%s: i2c client is NULL. Device not accessible.\n",
> -			__func__);
> -		return -ENODEV;
> -	}
> -
>  	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
>  		dev_info(&client->dev, "client not i2c capable\n");
>  		return -ENODEV;
> diff --git a/drivers/char/tpm/st33zp24/spi.c b/drivers/char/tpm/st33zp24/spi.c
> index 25b0e7994d27..c249d3f964fd 100644
> --- a/drivers/char/tpm/st33zp24/spi.c
> +++ b/drivers/char/tpm/st33zp24/spi.c
> @@ -223,13 +223,6 @@ static int st33zp24_spi_probe(struct spi_device *dev)
>  {
>  	struct st33zp24_spi_phy *phy;
>  
> -	/* Check SPI platform functionnalities */
> -	if (!dev) {
> -		pr_info("%s: dev is NULL. Device is not accessible.\n",
> -			__func__);
> -		return -ENODEV;
> -	}
> -
>  	phy = devm_kzalloc(&dev->dev, sizeof(struct st33zp24_spi_phy),
>  			   GFP_KERNEL);
>  	if (!phy)
> -- 
> 2.38.0.135.g90850a2211-goog
> 


Reviewed-by: Jarkko Sakkinen <jarkko@...nel.org>

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ