On Sat, Jul 26, 2025 at 04:29:54PM +0000, Kandpal, Suraj wrote: > > > > -----Original Message----- > > From: Dmitry Baryshkov <dmitry.barysh...@oss.qualcomm.com> > > Sent: Saturday, July 26, 2025 6:11 PM > > To: Kandpal, Suraj <suraj.kand...@intel.com> > > Cc: dri-de...@lists.freedesktop.org; intel...@lists.freedesktop.org; intel- > > g...@lists.freedesktop.org; Nautiyal, Ankit K <ankit.k.nauti...@intel.com>; > > Murthy, Arun R <arun.r.mur...@intel.com>; Shankar, Uma > > <uma.shan...@intel.com> > > Subject: Re: [PATCH 17/28] drm/i915/writeback: Define function to destroy > > writeback connector > > > > On Fri, Jul 25, 2025 at 10:33:58AM +0530, Suraj Kandpal wrote: > > > Define function to destroy the drm_writbeack_connector and > > > drm_connector associated with it. > > > > > > Signed-off-by: Suraj Kandpal <suraj.kand...@intel.com> > > > --- > > > drivers/gpu/drm/i915/display/intel_writeback.c | 7 +++++++ > > > 1 file changed, 7 insertions(+) > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_writeback.c > > > b/drivers/gpu/drm/i915/display/intel_writeback.c > > > index def33191a89e..9b2432d86d35 100644 > > > --- a/drivers/gpu/drm/i915/display/intel_writeback.c > > > +++ b/drivers/gpu/drm/i915/display/intel_writeback.c > > > @@ -180,6 +180,12 @@ intel_writeback_detect(struct drm_connector > > *connector, > > > return connector_status_connected; > > > } > > > > > > +static void intel_writeback_connector_destroy(struct drm_connector > > > +*connector) { > > > + drm_connector_cleanup(connector); > > > + kfree(connector); > > > +} > > > > Nice example of what I've written in my response to the cover letter: > > without this commit we have a memory leak here, don't we? > > No we really don't none of this actually takes affect until the connector > init is called which is way later > So to answer your question this won't really cause a crash and is very > bisectable
Ack, thanks. Then it's a fine way to implement the callbacks. > > Regards, > Suraj Kandpal > > > > > > + > > > static struct drm_writeback_connector * > > > intel_get_writeback_connector(struct drm_connector *connector) { @@ > > > -208,6 +214,7 @@ const struct drm_connector_funcs conn_funcs = { > > > .fill_modes = drm_helper_probe_single_connector_modes, > > > .atomic_duplicate_state = intel_digital_connector_duplicate_state, > > > .atomic_destroy_state = > > drm_atomic_helper_connector_destroy_state, > > > + .destroy = intel_writeback_connector_destroy, > > > }; > > > > > > static const struct drm_connector_helper_funcs conn_helper_funcs = { > > > -- > > > 2.34.1 > > > > > > > -- > > With best wishes > > Dmitry -- With best wishes Dmitry