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: <a618bb76-af82-4b47-a68c-8fc83cad97cb@kernel.org>
Date: Tue, 26 Aug 2025 14:10:03 +0900
From: Damien Le Moal <dlemoal@...nel.org>
To: Abinash Singh <abinashsinghlalotra@...il.com>, bvanassche@....org
Cc: James.Bottomley@...senPartnership.com, linux-kernel@...r.kernel.org,
 linux-scsi@...r.kernel.org, martin.petersen@...cle.com
Subject: Re: [PATCH v10 3/3] scsi: sd: make sd_revalidate_disk() return void

On 8/26/25 03:39, Abinash Singh wrote:
> The sd_revalidate_disk() function currently returns 0 for
> both success and memory allocation failure.Since none of its
> callers use the return value, this return code is both unnecessary
> and potentially misleading.
> 
> Change the return type of sd_revalidate_disk() from int to void
> and remove all return value handling. This makes the function
> semantics clearer and avoids confusion about unused return codes.
> 
> Reviewed-by: Bart Van Assche <bvanassche@....org>
> Reviewed-by: Damien Le Moal <dlemoal@...nel.org>
> Signed-off-by: Abinash Singh <abinashsinghlalotra@...il.com>

[...]

>  	lim = kmalloc(sizeof(*lim), GFP_KERNEL);
>  	if (!lim)
> -		goto out;
> +		return;
>  
>  	buffer = kmalloc(SD_BUF_SIZE, GFP_KERNEL);
>  	if (!buffer)
> @@ -3823,7 +3823,6 @@ static int sd_revalidate_disk(struct gendisk *disk)
>  	kfree(buffer);
>  	kfree(lim);
>  

Nit: please delete the blank line above too.

> -	return err;
>  }
>  
>  /**


-- 
Damien Le Moal
Western Digital Research

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ