Skip to content

scsi: sd: Fix build warning in sd_revalidate_disk()

Abinash Singh linux-scsi lkml 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest2 patches 2 repliesIn review
  2. v72 patches 2 repliesSuperseded
  3. v62 patches 1 replySuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v52 patches0 repliesSuperseded
v41 patch1 replySuperseded
v31 patch1 replySuperseded
v21 patch1 replySuperseded
v1 RFC1 patch1 replySuperseded

Changes in v8 from the cover letter

- 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.

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2scsi: sd: Fix build warning in sd_revalidate_disk()drivers/scsi/sd.c+31 -222 replies
2/2scsi: sd: make sd_revalidate_disk() return voiddrivers/scsi/sd.c+5 -60 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchBart Van Assche
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

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

Hi all,

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

Quoted 5 lines · 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(-)
Signature · 1 line
2.43.0