Skip to contentSkip to conversation

pmcraid_chr_ioctl uses incorrect argument order to kmalloc()

PATCH Dave Jones 1 participant 1 message Oct 24, 2011

Subsystems (2)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

Size is 1st arg, not second.

drivers/scsi/pmcraid.c +1 -1
index d079f9a..da19bdf 100644
@@ -4103,7 +4103,7 @@ static long pmcraid_chr_ioctl(
 	struct pmcraid_ioctl_header *hdr = NULL;
 	int retval = -ENOTTY;
 
-	hdr = kmalloc(GFP_KERNEL, sizeof(struct pmcraid_ioctl_header));
+	hdr = kmalloc(sizeof(struct pmcraid_ioctl_header), GFP_KERNEL);
 
 	if (!hdr) {
 		pmcraid_err("faile to allocate memory for ioctl header\n");