aic7xxx/aic79xx: replaced string duplication code with kstrdup
Subsystems (2)
PATCH 1/1 aic7xxx/aic79xx: replaced string duplication code with kstrdup
Replaced kmalloc + strcpy code with kstrdup.
Found using coccinelle.
Signed-off-by Dragos Foianu <[email protected]>
--- drivers/scsi/aic7xxx/aic79xx_osm_pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/aic7xxx/aic79xx_osm_pci.c +1 -2
@@ -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 );
Signature · 1 line
1.7.10.4