On 12 Feb 2025, at 10:32, Dan Carpenter wrote: > On Wed, Feb 12, 2025 at 10:30:26AM -0500, Zi Yan wrote: >> Hi Dan, >> >> Thanks for reporting, but based on __split_unmmaped_folio()’s call site, >> mapping cannot be NULL when it is dereferenced. Is there a proper way to >> tell Smatch that? VM_BUG_ON(folio_test_anon(folio) || !mapping) might >> help the first case, but not sure about the second one. >> > > No, just ignore the warning. I'll probably send another email if you > ever rename the function, but I try not to... Thanks for taking a look > at this. Thanks. I do think these reports are helpful, since they force me to spell out the implications. For the second case, when mapping is NULL __folio_split() sets end to -1 which is the max value of pgoff_t and folio->index would not reach to that value , then in __split_unmapped_folio() at line 3586 in the report, release->index can only be >= end when mapping is not NULL. This means line 3587 can be true and nr_dropped (line 3588) can become non-zero, when mapping is not NULL . I write this down for the record. Best Regards, Yan, Zi