aic7xxx: Use kstrdup
[deliverable/linux.git] / drivers / scsi / aic7xxx / aic79xx_osm_pci.c
index 3c85873b14b902ae128ec9a4626fa8220ab56218..8466aa784ec1aab828af2399fa80b3792e0d6290 100644 (file)
@@ -178,10 +178,9 @@ ahd_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                ahd_get_pci_bus(pci),
                ahd_get_pci_slot(pci),
                ahd_get_pci_function(pci));
-       name = kmalloc(strlen(buf) + 1, GFP_ATOMIC);
+       name = kstrdup(buf, GFP_ATOMIC);
        if (name == NULL)
                return (-ENOMEM);
-       strcpy(name, buf);
        ahd = ahd_alloc(NULL, name);
        if (ahd == NULL)
                return (-ENOMEM);
This page took 0.025714 seconds and 5 git commands to generate.