Re: [PATCH v8 1/2] scsi: sd: Fix build warning in sd_revalidate_disk()
From: Bart Van Assche
Date: Fri Aug 22 2025 - 15:48:44 EST
On 8/20/25 7:45 AM, Abinash Singh wrote:
+ lim = kmalloc(sizeof(*lim), GFP_KERNEL);
+ if (!lim) {
+ sd_printk(KERN_WARNING, sdkp,
+ "sd_revalidate_disk: Disk limit allocation failure.\n");
+ goto out;
+ }
From Documentation/process/coding-style.rst:
These generic allocation functions all emit a stack dump on failure when
used
without __GFP_NOWARN so there is no use in emitting an additional failure
message when NULL is returned.
buffer = kmalloc(SD_BUF_SIZE, GFP_KERNEL);
if (!buffer) {
sd_printk(KERN_WARNING, sdkp, "sd_revalidate_disk: Memory "
Has this example perhaps been followed? I think it is safe to remove
this sd_printk() statement.
Otherwise this patch looks good to me.
Thanks,
Bart.