On Fri, Apr 11, 2025 at 11:31:24AM -0500, Mark Tinguely wrote:
In the page to order 0 folio conversion series, the commit 7e119cff9d0a, "ocfs2: convert w_pages to w_folios" and commit 9a5e08652dc4b, "ocfs2: use an array of folios instead of an array of pages", saves -ENOMEM in the folio array upon allocation failure and calls the folio array free code. The folio array free code expects either valid folio pointers or NULL. Finding the -ENOMEM will result in a panic. Fix by NULLing the error folio entry.
Signed-off-by: Mark Tinguely mark.tinguely@oracle.com Cc: stable@vger.kernel.org Cc: Changwei Ge gechangwei@live.cn Cc: Joel Becker jlbec@evilplan.org Cc: Junxiao Bi junxiao.bi@oracle.com Cc: Mark Fasheh mark@fasheh.com Cc: Matthew Wilcox willy@infradead.org
Reviewed-by: Matthew Wilcox (Oracle) willy@infradead.org