mpam: Cleanup error handling in mpam_msc_drv_probe
Prior to this commit, some error cases in this function would leave data in an inconsistent state. Most notably, any errors after the do/while block would leave the newly-added msc on the global list, but this msc would be freed by the platform_device error-handling code paths, leaving a corrupt list and problems down the road. Additionally, earlier error paths in this function were inconsistent both about whether msc was immediately freed and whether after being freed it was set to an error value. Finally, other cleanup, such as cleaning up any mpam_msc_ris objects was never previously done. These issues are addressed in this commit by consolidating all cleanup into a single block at the end of the function, and reordering the initialization so that keying off of a non-NULL msc is sufficient to determine that all the cleanup code should be executed. Signed-off-by:Carl Worth <carl@os.amperecomputing.com> [ morse: dropped unneeded srcu call, moved over to garbage code ] Signed-off-by:
James Morse <james.morse@arm.com>
Loading
Please register or sign in to comment