File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -898,7 +898,8 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
898
898
if (vmd -> instance < 0 )
899
899
return vmd -> instance ;
900
900
901
- vmd -> name = kasprintf (GFP_KERNEL , "vmd%d" , vmd -> instance );
901
+ vmd -> name = devm_kasprintf (& dev -> dev , GFP_KERNEL , "vmd%d" ,
902
+ vmd -> instance );
902
903
if (!vmd -> name ) {
903
904
err = - ENOMEM ;
904
905
goto out_release_instance ;
@@ -936,7 +937,6 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
936
937
937
938
out_release_instance :
938
939
ida_simple_remove (& vmd_instance_ida , vmd -> instance );
939
- kfree (vmd -> name );
940
940
return err ;
941
941
}
942
942
@@ -959,7 +959,6 @@ static void vmd_remove(struct pci_dev *dev)
959
959
vmd_detach_resources (vmd );
960
960
vmd_remove_irq_domain (vmd );
961
961
ida_simple_remove (& vmd_instance_ida , vmd -> instance );
962
- kfree (vmd -> name );
963
962
}
964
963
965
964
#ifdef CONFIG_PM_SLEEP
You can’t perform that action at this time.
0 commit comments