Skip to content

Commit d842da6

Browse files
avinashlalotramartinkpetersen
authored andcommitted
scsi: sd: Remove redundant printk() after kmalloc() failure
The SCSI disk driver prints a warning when kmalloc() fails in sd_revalidate_disk(). This is redundant because the page allocator already reports failures unless __GFP_NOWARN is used. Keeping the extra message only adds noise to the kernel log. Remove the unnecessary sd_printk() call. Control flow is unchanged. Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Abinash Singh <abinashsinghlalotra@gmail.com> Link: https://lore.kernel.org/r/20250825183940.13211-3-abinashsinghlalotra@gmail.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent b5f717b commit d842da6

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/scsi/sd.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3716,11 +3716,8 @@ static int sd_revalidate_disk(struct gendisk *disk)
37163716
goto out;
37173717

37183718
buffer = kmalloc(SD_BUF_SIZE, GFP_KERNEL);
3719-
if (!buffer) {
3720-
sd_printk(KERN_WARNING, sdkp, "sd_revalidate_disk: Memory "
3721-
"allocation failure.\n");
3719+
if (!buffer)
37223720
goto out;
3723-
}
37243721

37253722
sd_spinup_disk(sdkp);
37263723

0 commit comments

Comments
 (0)