> > + if (WARN_ON(IS_ERR(object))) > > Wonder if WARN_ON_ONCE() would be better. > Also wonder about the benefits for hardening (as opposed to debugging). > Without this check it would fault. Now it warns, but hardened setups often > use panic_on_warn anyway, so the result is the same? >
Yes, I'll switch to WARN_ON_ONCE(). You're right about panic_on_warn. The benefit is a clearer diagnostic and, when warnings aren't fatal, returning before virt_to_page(). I'll split out the ERR_PTR patches as Harry suggested and recheck the KUnit warning-count test with WARN_ON_ONCE(). Thanks, Karl

