On Tue, Jul 07, 2020 at 02:24:26PM -0700, Jakub Kicinski wrote: > debugfs_create_u32_array() allocates a small structure to wrap > the data and size information about the array. If users ever > try to remove the file this leads to a leak since nothing ever > frees this wrapper. > > That said there are no upstream users of debugfs_create_u32_array() > that'd remove a u32 array file (we only have one u32 array user in > CMA), so there is no real bug here. > > Make callers pass a wrapper they allocated. This way the lifetime > management of the wrapper is on the caller, and we can avoid the > potential leak in debugfs. > > CC: Greg Kroah-Hartman <[email protected]> > CC: Marek Szyprowski <[email protected]> > CC: Chucheng Luo <[email protected]> > Signed-off-by: Jakub Kicinski <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
