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]
Date:   Fri, 18 Jun 2021 10:20:53 +0200
From:   Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
To:     samirweng1979 <samirweng1979@....com>, charles.gorand@...innov.com
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        wengjianfeng <wengjianfeng@...ong.com>
Subject: Re: [PATCH] NFC: nxp-nci: remove unnecessary label

On 18/06/2021 09:44, samirweng1979 wrote:
> From: wengjianfeng <wengjianfeng@...ong.com>
> 
> Label chunk_exit is unnecessary, so we delete it and
> directly return -ENOMEM.

There is no plural here, no collective "we". Please, use simple statements:
"Remove unnecessary label chunk_exit and return directly."

You could add here the explanation for question "why doing this?", e.g.
"Simplify the code by removing unnecessary label chunk_exit and
returning directly."

> 
> Signed-off-by: wengjianfeng <wengjianfeng@...ong.com>
> ---
>  drivers/nfc/nxp-nci/firmware.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/nfc/nxp-nci/firmware.c b/drivers/nfc/nxp-nci/firmware.c
> index dae0c80..119bf30 100644
> --- a/drivers/nfc/nxp-nci/firmware.c
> +++ b/drivers/nfc/nxp-nci/firmware.c
> @@ -95,10 +95,8 @@ static int nxp_nci_fw_send_chunk(struct nxp_nci_info *info)
>  	int r;
>  
>  	skb = nci_skb_alloc(info->ndev, info->max_payload, GFP_KERNEL);
> -	if (!skb) {
> -		r = -ENOMEM;
> -		goto chunk_exit;
> -	}
> +	if (!skb)
> +		return -ENOMEM;
>  
>  	chunk_len = info->max_payload - NXP_NCI_FW_HDR_LEN - NXP_NCI_FW_CRC_LEN;
>  	remaining_len = fw_info->frame_size - fw_info->written;
> @@ -124,7 +122,6 @@ static int nxp_nci_fw_send_chunk(struct nxp_nci_info *info)
>  
>  	kfree_skb(skb);
>  
> -chunk_exit:
>  	return r;
>  }
>  
> 


Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ