[PATCH v8 0/2] scsi: sd: Fix build warning in sd_revalidate_disk()

Abinash Singh posted 2 patches 1 month, 2 weeks ago
drivers/scsi/sd.c | 56 +++++++++++++++++++++++++++--------------------
1 file changed, 32 insertions(+), 24 deletions(-)
[PATCH v8 0/2] scsi: sd: Fix build warning in sd_revalidate_disk()
Posted by Abinash Singh 1 month, 2 weeks ago
Hi all,

This v8 series follows up on v7 of the
"scsi: sd: Fix build warning in sd_revalidate_disk()" patches.

On Tue, 19 Aug 2025 Bart Van Assche wrote:
> The traditional order for kfree() statements is the opposite order of
> the corresponding kmalloc() calls.
>
> Shouldn't this patch remove the initializer from the 'err' variable?
> Otherwise this patch looks good to me.

Based on Bart’s feedback, I have addressed the following in v8:

Changes in v8:
  - Patch 1/2:
      * Reverse the order of kfree() calls to follow the conventional
        opposite-of-kmalloc() order.
      * Added Bart Van Assche’s Reviewed-by tag.
  - Patch 2/2:
      * Removed the unused ‘err’ variable initializer.

As before, the first patch fixes the stack usage warning by moving a
large struct off the stack (with Fixes and Cc: stable tags). The second
patch then simplifies sd_revalidate_disk() by making it return void.

Many thanks to Bart and Damien for their reviews and guidance.


Abinash Singh (2):
  scsi: sd: Fix build warning in sd_revalidate_disk()
  scsi: sd: make sd_revalidate_disk() return void

 drivers/scsi/sd.c | 56 +++++++++++++++++++++++++++--------------------
 1 file changed, 32 insertions(+), 24 deletions(-)

-- 
2.43.0