<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Jun 20, 2025 at 4:11 AM Maxime Ripard <<a href="mailto:mripard@kernel.org">mripard@kernel.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Jun 20, 2025 at 10:33:53AM +0200, Luca Ceresoli wrote:<br>
> Hello Anusha,<br>
> <br>
> On Thu, 19 Jun 2025 14:15:53 -0500<br>
> Anusha Srivatsa <<a href="mailto:asrivats@redhat.com" target="_blank">asrivats@redhat.com</a>> wrote:<br>
> <br>
> > Take the panel reference and put it back as required.<br>
> > drm_panel_add() and drm_panel_remove() add a panel to<br>
> > the global registry and removes a panel respectively.<br>
> > Use get() and put() helpers to keep up with refcounting.<br>
> > <br>
> > Reviewed-by: Luca Ceresoli <<a href="mailto:luca.ceresoli@bootlin.com" target="_blank">luca.ceresoli@bootlin.com</a>><br>
> > Signed-off-by: Anusha Srivatsa <<a href="mailto:asrivats@redhat.com" target="_blank">asrivats@redhat.com</a>><br>
> <br>
> This patch is good.<br>
> <br>
> I'd just point out that this must be applied only after all drivers<br>
> have been converted to the the _alloc API, otherwise with the following<br>
> sequence:<br>
> <br>
> panel = devm_kzalloc();<br>
> drm_panel_init(panel);<br>
> drm_panel_add(panel);<br>
> ...<br>
> drm_panel_remove(panel); <-----<br>
> <br>
> at the drm_panel_remove() you'd have a warning:<br>
> <br>
> refcount_t: addition on 0; use-after-free.<br>
<br></blockquote><div>Yes, Luca. makes sense. Thanks.</div><div>You had reviewed this patch already, but thanks :)</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> So, if all panel drivers are converted:<br>
<br>
Not all panels are yet:<br>
$ rg -l drm_panel_init -- drivers/gpu/drm/panel/ | wc -l<br>
20<br></blockquote><div>^^^^^ <br></div><div> Yup. Looks like there are some more occurences. On it.</div><div><br></div><div>Anusha</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Maxime<br>
</blockquote></div></div>