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: <94177278-c8fe-89f3-97f0-7010078b9ba2@canonical.com>
Date:   Mon, 26 Jul 2021 09:55:27 +0200
From:   Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
To:     samirweng1979 <samirweng1979@....com>, k.opasiak@...sung.com
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        wengjianfeng <wengjianfeng@...ong.com>
Subject: Re: [PATCH] nfc: s3fwrn5: remove unnecessary label

On 26/07/2021 05:29, samirweng1979 wrote:
> From: wengjianfeng <wengjianfeng@...ong.com>
> 
> Simplify the code by removing unnecessary label and returning directly.
> 
> Signed-off-by: wengjianfeng <wengjianfeng@...ong.com>
> ---
>  drivers/nfc/s3fwrn5/firmware.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>

Best regards,
Krzysztof

> diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c
> index eb5d7a5b..1421ffd 100644
> --- a/drivers/nfc/s3fwrn5/firmware.c
> +++ b/drivers/nfc/s3fwrn5/firmware.c
> @@ -421,10 +421,9 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info)
>  
>  	tfm = crypto_alloc_shash("sha1", 0, 0);
>  	if (IS_ERR(tfm)) {
> -		ret = PTR_ERR(tfm);
>  		dev_err(&fw_info->ndev->nfc_dev->dev,
>  			"Cannot allocate shash (code=%d)\n", ret);
> -		goto out;
> +		return PTR_ERR(tfm);
>  	}
>  
>  	ret = crypto_shash_tfm_digest(tfm, fw->image, image_size, hash_data);
> @@ -433,7 +432,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info)
>  	if (ret) {
>  		dev_err(&fw_info->ndev->nfc_dev->dev,
>  			"Cannot compute hash (code=%d)\n", ret);
> -		goto out;
> +		return ret;
>  	}
>  
>  	/* Firmware update process */
> @@ -446,7 +445,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info)
>  	if (ret < 0) {
>  		dev_err(&fw_info->ndev->nfc_dev->dev,
>  			"Unable to enter update mode\n");
> -		goto out;
> +		return ret;
>  	}
>  
>  	for (off = 0; off < image_size; off += fw_info->sector_size) {
> @@ -455,7 +454,7 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info)
>  		if (ret < 0) {
>  			dev_err(&fw_info->ndev->nfc_dev->dev,
>  				"Firmware update error (code=%d)\n", ret);
> -			goto out;
> +			return ret;
>  		}
>  	}
>  
> @@ -463,13 +462,12 @@ int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info)
>  	if (ret < 0) {
>  		dev_err(&fw_info->ndev->nfc_dev->dev,
>  			"Unable to complete update mode\n");
> -		goto out;
> +		return ret;
>  	}
>  
>  	dev_info(&fw_info->ndev->nfc_dev->dev,
>  		"Firmware update: success\n");
>  
> -out:
>  	return ret;
>  }
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ