Re: [PATCH v2] floppy: fix reference leak on platform_device_register() failure

Greg KH
2026-04-24T04:15:38Z

On Fri, Apr 24, 2026 at 11:14:17AM +0800, Guangshuo Li wrote:
> Hi Jiri, Jens,
>
> Thanks for the review and for catching this.
>
> On Thu, 23 Apr 2026 at 19:06, Jens Axboe <axboe@kernel.dk> wrote:
> >
> > > The patch is likely wrong. Given the pdev is static, the struct device
> > > has no ->release, so releasing it will trigger a warning. AFAIR, the
> > > consensus was to fix platform_device_register() proper.
> >
> > Thanks for letting me know, I'll revert this change for now.
> >
>
> You are right that this fix is not appropriate for this case. Since the
> platform device is static and the embedded struct device has no release
> callback, calling platform_device_put() / releasing it here is wrong and
> can trigger warnings.
>
> Please disregard this patch. I will drop it and not pursue it further in
> its current form.

Can you go back and verify that all of the other patches you sent out
for this same pattern are also either ignored, or reverted?

thanks,

greg k-h