From: Markus Elfring Date: Fri, 16 Feb 2018 13:04:49 +0000 (+0100) Subject: pata_it821x: Delete an error message for a failed memory allocation in it821x_firmwar... X-Git-Tag: v4.17-rc1~142^2~16 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ef59a62afdd223dadf74a22e994ab79d6bf4f2df;p=tomoyo%2Ftomoyo-test1.git pata_it821x: Delete an error message for a failed memory allocation in it821x_firmware_command() Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Tejun Heo --- diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index 8468b300193b..9bac79edbc2c 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c @@ -658,10 +658,10 @@ static u8 *it821x_firmware_command(struct ata_port *ap, u8 cmd, int len) u8 status; int n = 0; u16 *buf = kmalloc(len, GFP_KERNEL); - if (buf == NULL) { - printk(KERN_ERR "it821x_firmware_command: Out of memory\n"); + + if (!buf) return NULL; - } + /* This isn't quite a normal ATA command as we are talking to the firmware not the drives */ ap->ctl |= ATA_NIEN;