Message ID | c28ba397-0b6c-fe47-24d8-002545b4844f@users.sourceforge.net |
---|---|
State | Deferred |
Delegated to: | David Miller |
Headers | show |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 0b63fac..645a67b 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -973,8 +973,9 @@ static int hwif_init(ide_hwif_t *hwif) if (!hwif->sg_max_nents) hwif->sg_max_nents = PRD_ENTRIES; - hwif->sg_table = kmalloc(sizeof(struct scatterlist)*hwif->sg_max_nents, - GFP_KERNEL); + hwif->sg_table = kmalloc_array(hwif->sg_max_nents, + sizeof(*hwif->sg_table), + GFP_KERNEL); if (!hwif->sg_table) { printk(KERN_ERR "%s: unable to allocate SG table.\n", hwif->name); goto out;