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: <85bbc91f-7b91-46fc-acff-3bcc2288c4ae@acm.org>
Date:   Thu, 28 May 2020 07:56:14 -0700
From:   Bart Van Assche <bvanassche@....org>
To:     Bean Huo <huobean@...il.com>, alim.akhtar@...sung.com,
        avri.altman@....com, asutoshd@...eaurora.org, jejb@...ux.ibm.com,
        martin.petersen@...cle.com, stanley.chu@...iatek.com,
        beanhuo@...ron.com, tomas.winkler@...el.com, cang@...eaurora.org
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/3] scsi: ufs: remove max_t in ufs_get_device_desc

On 2020-05-28 04:56, Bean Huo wrote:
> From: Bean Huo <beanhuo@...ron.com>
> 
> For the UFS device, the maximum descriptor size is 255, max_t called in
> ufs_get_device_desc() is useless.
> 
> Signed-off-by: Bean Huo <beanhuo@...ron.com>
> ---
>  drivers/scsi/ufs/ufshcd.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index aca50ed39844..0f8c7e05df29 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -6881,8 +6881,7 @@ static int ufs_get_device_desc(struct ufs_hba *hba)
>  	u8 *desc_buf;
>  	struct ufs_dev_info *dev_info = &hba->dev_info;
>  
> -	buff_len = max_t(size_t, hba->desc_size.dev_desc,
> -			 QUERY_DESC_MAX_SIZE + 1);
> +	buff_len = QUERY_DESC_MAX_SIZE + 1;
>  	desc_buf = kmalloc(buff_len, GFP_KERNEL);
>  	if (!desc_buf) {
>  		err = -ENOMEM;

Since the buff_len variable is not changed after its initial assignment,
please remove it entirely.

Thanks,

Bart.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ