On Thu, Dec 07, 2023 at 12:18:13PM +0200, Jani Nikula wrote: > On Wed, 06 Dec 2023, Maxime Ripard <mripard@xxxxxxxxxx> wrote: > > All of the current plane init / allocation functions behave slightly > > differently when it comes to argument sanitizing: > > > > - drm_universal_plane_init() implicitly panics if the drm_device > > pointer or the drm_plane_funcs pointer are NULL, and calls WARN_ON if > > there's no destroy implementation but goes on with the initialization. > > > > - drm_universal_plane_alloc() implicitly panics if the drm_device > > pointer is NULL, and will call WARN_ON and return an error if the > > drm_plane_funcs pointer is NULL. > > > > - drmm_universal_plane_alloc() implicitly panics if the drm_device > > pointer is NULL, and will call WARN_ON and return an error if the > > drm_plane_funcs pointer is NULL or if there is a destroy > > implementation. > > NULL deref oopses but doesn't necessarily panic, right? Adding BUG() or > BUG_ON() to unconditionally panic is not the way to go, either. Sigh... Your whole argument was that it was a precondition, and what the current code was doing is just like an assertion. An assertion will stop the execution of the program it's in. If panicking isn't the way to go, then what is? Maxime
Attachment:
signature.asc
Description: PGP signature