Skip to content

Commit

Permalink
pata_it821x: Delete an error message for a failed memory allocation i…
Browse files Browse the repository at this point in the history
…n 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 <elfring@users.sourceforge.net>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Markus Elfring authored and Tejun Heo committed Feb 18, 2018
1 parent 3e34277 commit ef59a62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/ata/pata_it821x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ef59a62

Please sign in to comment.