]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/ide/ide-probe.c
[SG] Update drivers to use sg helpers
[mirror_ubuntu-zesty-kernel.git] / drivers / ide / ide-probe.c
index d5146c57e5b3151e33bcb0defc4496d25bcef674..ec55a173c08a47b3e1da8cf4b976b650d7b7794e 100644 (file)
@@ -1317,12 +1317,14 @@ static int hwif_init(ide_hwif_t *hwif)
        if (!hwif->sg_max_nents)
                hwif->sg_max_nents = PRD_ENTRIES;
 
-       hwif->sg_table = kzalloc(sizeof(struct scatterlist)*hwif->sg_max_nents,
+       hwif->sg_table = kmalloc(sizeof(struct scatterlist)*hwif->sg_max_nents,
                                 GFP_KERNEL);
        if (!hwif->sg_table) {
                printk(KERN_ERR "%s: unable to allocate SG table.\n", hwif->name);
                goto out;
        }
+
+       sg_init_table(hwif->sg_table, hwif->sg_max_nents);
        
        if (init_irq(hwif) == 0)
                goto done;