[PATCH v2] drm: set is_master to 0 upon drm_new_set_master() failure

2018-11-22 Thread Sergio Correia
When drm_new_set_master() fails, set is_master to 0, to prevent a possible NULL pointer deref. Here is a problematic flow: we check is_master in drm_is_current_master(), then proceed to call drm_lease_owner() passing master. If we do not restore is_master status when drm_new_set_master() fails, we

Re: [PATCH v2] drm: set is_master to 0 upon drm_new_set_master() failure

2018-11-22 Thread Daniel Vetter
On Thu, Nov 22, 2018 at 02:33:29AM -0300, Sergio Correia wrote: > When drm_new_set_master() fails, set is_master to 0, to prevent a > possible NULL pointer deref. > > Here is a problematic flow: we check is_master in drm_is_current_master(), > then proceed to call drm_lease_owner() passing master.