Re: [PATCH v6 1/3] spi: spi-nxp-fspi: check return value of devm_mutex_init()

From: Andy Shevchenko
Date: Tue Jun 10 2025 - 05:58:54 EST


On Mon, Jun 09, 2025 at 09:59:46PM +0100, Mark Brown wrote:
> On Mon, Jun 09, 2025 at 10:38:37PM +0200, Thomas Weißschuh wrote:
> > Even if it's not critical, the avoidance of checking the error code
> > from devm_mutex_init() call today diminishes the point of using devm
> > variant of it. Tomorrow it may even leak something.
>
> I don't understand the comment about leaking here? We might end up with
> an unitialised mutex but how would we leak anything?

In case if the mutex_init() allocates something that needs to be freed
(in the future).

--
With Best Regards,
Andy Shevchenko