Re: [PATCH v4 01/18] PCI/P2PDMA: Do not tear down the allocate attribute on registration failure
Jason Gunthorpe <[email protected]>
| Newsgroups | org.kernel.vger.linux-doc,dev.linux.lists.iommu,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci |
|---|---|
| Message-ID | <178761377033.3197084.4177392176378899499.b4-review@b4> |
> [ ... 18 lines skipped ... ] > devm_add_action_or_reset() runs the action when it cannot allocate its > devres node, so an -ENOMEM while registering a second BAR unmaps the > first one. Use devm_add_action() and let the error path unwind only what > this call created. It is so weird we have multiple devres's removing the single shared sysfs function.. I guess the secondary ones are all NOPs? Oh well, this is an improvement: Reviewed-by: Jason Gunthorpe <[email protected]> -- Jason