Re: [PATCH] eeprom: digsy_mtc: fix reference leak on failed device registration

From: Andy Shevchenko

Date: Fri Apr 24 2026 - 04:36:55 EST


On Fri, Apr 24, 2026 at 04:21:05PM +0800, Guangshuo Li wrote:
> On Thu, 16 Apr 2026 at 15:52, Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > On Thu, Apr 16, 2026 at 12:52:02AM +0800, Guangshuo Li wrote:

...

> After re-checking it, digsy_mtc_eeprom is a static platform_device and it
> does not provide a dev.release callback. Therefore calling
> platform_device_put() on the platform_device_register() failure path is
> not appropriate here and can trigger the missing release callback warning.
>
> This falls into the same static platform_device pattern pointed out in
> the other reviews, so I will drop this patch.

Ah, good point! Indeed, this device is either present for the entire system
run-time or not at all. Even if it's erroneously attempted to be instantiated
it's still not a big deal.

--
With Best Regards,
Andy Shevchenko