Re: [PATCH v4 01/18] PCI/P2PDMA: Do not tear down the allocate attribute on registration failure
From: Jason Gunthorpe
Date: Mon Aug 24 2026 - 19:24:43 EST
> [ ... 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 <jgg@xxxxxxxxxx>
--
Jason