Re: [PATCH v2] leds: lp5860: Return an error for an out-of-range 'reg' property

From: Mert Seftali

Date: Thu Jul 02 2026 - 13:29:27 EST


On Thu, 2 Jul 2026, Lee Jones wrote:
> This isn't a bug introduced by this patch, but while reviewing the driver
> I noticed a double unlock in lp5860_device_init():
[...]
> If lp5860_init_dt() fails, doesn't the jump to err_disable result in
> calling mutex_unlock() on an already unlocked mutex?

Confirmed, i'll move the unlock out of err_disable so it can't fire twice.

> This is also a pre-existing issue, but I noticed a potential
> use-after-destroy involving the same mutex in the removal path:
[...]
> Does this sequence result in lp5860_chip_enable() locking a mutex that
> was just destroyed by lp5860_remove()?

i'll swap the order so device_remove() runs before
mutex_destroy().

I'll send both as a small two-patch series crediting you as
Reported-by or let me know if you'd rather the Sashiko findings be credited
to the tool instead.

thanks for flagging these!
Mert