A vulnerability in the Linux kernel's gpiolib subsystem caused a GPIO descriptor leak in the gpiod_get_array() function. The issue occurs when krealloc() fails on the first iteration of a loop, leading to a descriptor being acquired but not properly released, resulting in a resource leak. The flaw has been fixed by adjusting the loop variable usage and descriptor counting logic.