On 2018-09-25 11:29 a.m., Bart Van Assche wrote: > On Tue, 2018-09-25 at 10:22 -0600, Logan Gunthorpe wrote: >> @@ -83,9 +132,14 @@ static int pci_p2pdma_setup(struct pci_dev *pdev) >> >> pdev->p2pdma = p2p; >> >> + error = sysfs_create_group(&pdev->dev.kobj, &p2pmem_group); >> + if (error) >> + goto out_pool_destroy; >> + >> return 0; >> >> out_pool_destroy: >> + pdev->p2pdma = NULL; >> gen_pool_destroy(p2p->pool); >> out: >> devm_kfree(&pdev->dev, p2p); > > This doesn't look right to me. Shouldn't devm_remove_action() be called > instead > of devm_kfree() if sysfs_create_group() fails? That makes no sense to me. We are reversing a devm_kzalloc() not a custom action.... One could argue we should _also_ remove the pci_p2pdma_release() action, but seeing it has a NULL check on pdev->p2pdma it's pretty harmless to leave in. Logan _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm
- [PATCH v7 10/13] nvme-pci: Add support for P2P memory in r... Logan Gunthorpe
- Re: [PATCH v7 10/13] nvme-pci: Add support for P2P me... Keith Busch
- Re: [PATCH v7 10/13] nvme-pci: Add support for P2... Logan Gunthorpe
- Re: [PATCH v7 10/13] nvme-pci: Add support fo... Keith Busch
- [PATCH v7 13/13] nvmet: Optionally use PCI P2P memory Logan Gunthorpe
- [PATCH v7 09/13] nvme-pci: Use PCI p2pmem subsystem to man... Logan Gunthorpe
- [PATCH v7 05/13] docs-rst: Add a new directory for PCI doc... Logan Gunthorpe
- [PATCH v7 06/13] PCI/P2PDMA: Add P2P DMA driver writer's d... Logan Gunthorpe
- [PATCH v7 02/13] PCI/P2PDMA: Add sysfs group to display p2... Logan Gunthorpe
- Re: [PATCH v7 02/13] PCI/P2PDMA: Add sysfs group to d... Bart Van Assche
- Re: [PATCH v7 02/13] PCI/P2PDMA: Add sysfs group ... Logan Gunthorpe
- Re: [PATCH v7 02/13] PCI/P2PDMA: Add sysfs gr... Bart Van Assche
- Re: [PATCH v7 02/13] PCI/P2PDMA: Add sysf... Logan Gunthorpe
- [PATCH v7 12/13] nvmet: Introduce helper functions to allo... Logan Gunthorpe
- [PATCH v7 07/13] block: Add PCI P2P flag for request queue... Logan Gunthorpe
- [PATCH v7 11/13] nvme-pci: Add a quirk for a pseudo CMB Logan Gunthorpe
- [PATCH v7 03/13] PCI/P2PDMA: Add PCI p2pmem DMA mappings t... Logan Gunthorpe
- Re: [PATCH v7 03/13] PCI/P2PDMA: Add PCI p2pmem DMA m... Bart Van Assche
- Re: [PATCH v7 03/13] PCI/P2PDMA: Add PCI p2pmem D... Logan Gunthorpe
- [PATCH v7 01/13] PCI/P2PDMA: Support peer-to-peer memory Logan Gunthorpe
- Re: [PATCH v7 01/13] PCI/P2PDMA: Support peer-to-peer... Bart Van Assche