On Mon, Nov 20, 2023 at 03:47:17AM +0800, Kairui Song wrote: > From: Kairui Song <kasong@xxxxxxxxxxx> > > When folio is NULL, taking the address of its struct member is an > undefined behavior, the UB is caused by applying -> operator > to a pointer not pointing to any object. Although in practice this > won't lead to a real issue, still better to fix it, also makes the > code less error-prone, when folio is NULL, page is also NULL, > instead of a meanless offset value. Um, &folio->page is NULL if folio is NULL. The offset of 'page' within 'folio' is 0. By definition; and this will never change.