Re: [PATCH v2 2/7] gpiolib: fix fast-path cancellation in gpiod_get_array()
From: Andy Shevchenko
Date: Wed Nov 04 2026 - 07:10:07 EST
On Tue, Nov 03, 2026 at 07:40:30PM -0800, Dmitry Torokhov wrote:
> In gpiod_get_array(), when a pin on the same chip is not in hardware
> order and the preceding pins form a contiguous block, the fast path is
> cancelled by setting array_info to NULL. However, descs->info was
> already populated with the array_info pointer during the first
> iteration, leaving descs->info pointing to the aborted array_info.
> Consequently, subsequent array operations still use the fast path with
> remaining bits set in the masks and wrong hardware pin numbers.
>
> Clear descs->info alongside array_info when cancelling the fast path so
> callers do not erroneously use the aborted array_info.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
--
With Best Regards,
Andy Shevchenko