]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: sd: Remove redundant printk() after kmalloc() failure
authorAbinash Singh <abinashsinghlalotra@gmail.com>
Mon, 25 Aug 2025 18:39:39 +0000 (00:09 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 31 Aug 2025 01:18:27 +0000 (21:18 -0400)
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>
drivers/scsi/sd.c

index bf12e23f121213a01df48f1f60cab35e87bdf888..35856685d7fa2f6d02710d06fdcac3e96fed0a68 100644 (file)
@@ -3716,11 +3716,8 @@ static int sd_revalidate_disk(struct gendisk *disk)
                goto out;
 
        buffer = kmalloc(SD_BUF_SIZE, GFP_KERNEL);
-       if (!buffer) {
-               sd_printk(KERN_WARNING, sdkp, "sd_revalidate_disk: Memory "
-                         "allocation failure.\n");
+       if (!buffer)
                goto out;
-       }
 
        sd_spinup_disk(sdkp);